-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat/#4] jwt구현 중 및 폴더 삭제 #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
f7cd8b7
da7d785
17201b5
619fd1b
1dee4c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,9 +10,30 @@ services: | |
| ports: | ||
| - '5432:5432' | ||
| environment: | ||
| POSTGRES_USER: postgres # 기본 사용자를 postgres로 변경 (root도 가능) | ||
| POSTGRES_PASSWORD: 1234 # 비밀번호 설정 | ||
| POSTGRES_DB: stockdb # 사용할 DB 이름 | ||
| POSTGRES_USER: postgres | ||
| POSTGRES_PASSWORD: 1234 | ||
| POSTGRES_DB: stockdb | ||
|
|
||
| nestjs: | ||
| build: . | ||
| container_name: nestjs_app | ||
| restart: always | ||
| depends_on: | ||
| - postgres | ||
| ports: | ||
| - '3000:3000' | ||
| environment: | ||
| - DATABASE_HOST=postgres | ||
| - DATABASE_PORT=5432 | ||
| - DATABASE_USERNAME=postgres | ||
| - DATABASE_PASSWORD=1234 | ||
| - DATABASE_NAME=stockdb | ||
| networks: | ||
| - default | ||
|
Comment on lines
+17
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Use environment variable files for the NestJS service. |
||
|
|
||
| volumes: | ||
| postgres_data: # Docker가 자동으로 볼륨을 관리하도록 설정 | ||
| postgres_data: | ||
|
|
||
| networks: | ||
| default: | ||
| driver: bridge | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Node.js 이미지를 베이스로 사용 | ||
| FROM node:18 | ||
|
|
||
| # 앱 디렉터리 생성 | ||
| WORKDIR /usr/src/app | ||
|
|
||
| # 의존성 설치 | ||
| COPY package*.json ./ | ||
| RUN npm install | ||
|
|
||
| # 애플리케이션 소스 복사 | ||
| COPY . . | ||
|
|
||
| # 애플리케이션 빌드 | ||
| RUN npm run build | ||
|
|
||
| # 앱 실행 | ||
| EXPOSE 3000 | ||
| CMD ["npm", "run", "start:prod"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Store Postgres credentials securely.
Hardcoded credentials (
POSTGRES_USER,POSTGRES_PASSWORD,POSTGRES_DB) can lead to security risks. If this is for production, consider using Docker secrets or environment variables injected by your CI/CD pipeline.