Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# ------------------------
# ✅ 공통
# ------------------------
.DS_Store
*.pem
.vscode
.github

# 환경 변수
.env*
*.env

# 로그 파일
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# 커버리지
/coverage

# 빌드
/build
/dist

# ------------------------
# ✅ Node.js dependencies
# ------------------------
/node_modules

# ------------------------
# ✅ yarn / pnpm / berry
# ------------------------
.pnp.*
/.pnp
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# ------------------------
# ✅ BE 관련
prisma/dev.db
prisma/dev.db-journal
.env
node_modules
dist/*
!BE/dist/index.js
/src/generated/prisma
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:20.15.1-alpine3.19

ENV DOCKERIZE_VERSION v0.7.0
RUN apk update --no-cache \
&& apk add --no-cache wget openssl \
&& wget -O - https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | tar xzf - -C /usr/local/bin \
&& apk del wget

WORKDIR /app

EXPOSE 3000

COPY ./docker-entrypoint.sh ./docker-entrypoint.sh
RUN ["chmod", "+x", "./docker-entrypoint.sh"]
ENTRYPOINT ["sh", "./docker-entrypoint.sh"]
15 changes: 15 additions & 0 deletions constant/ExceptionMessage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* [에러 메시지 상수]
*
* 에러 메시지가 반복적으로 사용되는 경우, 상수로 관리하는 것이 효율적입니다.
*
* 여러 장점들:
* - 오타 방지
* - 추후 에러메시지 변경에 유리
* - ...
*/
export const ExceptionMessage = {
ARTICLE_NOT_FOUND: 'Article not found',
PRODUCT_NOT_FOUND: 'Product not found',
COMMENT_NOT_FOUND: 'Comment not found',
};
42 changes: 42 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
version: '2.2'

services:
pg-db:
image: postgres:16.3-alpine3.19
attach: false
container_name: panda-market-db
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=panda-market
networks:
- panda-market-network
ports:
- '15432:5432'
command: [postgres]

service:
container_name: panda-market-app
build:
context: .
dockerfile: ./Dockerfile
restart: no
environment:
# Application
- NODE_ENV=development
- DATABASE_URL=postgresql://postgres:postgres@pg-db:5432/panda-market
- JWT_ACCESS_TOKEN_SECRET=$3cr3t
- JWT_REFRESH_TOKEN_SECRET=$3cr3t
networks:
- panda-market-network
ports:
- '13000:3000'
volumes:
- .:/app/
depends_on:
- pg-db

networks:
panda-market-network:
name: panda-market-network
7 changes: 7 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dockerize -wait tcp://pg-db:5432 -timeout 60s

npx prisma generate
npx prisma migrate deploy
npm run seed

npm start
Binary file added google-auth-setting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading