8770b1b47b
Deploy / deploy (push) Successful in 19s
- 모든 서비스 ports -> expose로 변경 (외부 포트 노출 없음) - frontend/backend를 공용 proxy 네트워크에 연결 - npm이 컨테이너 이름(report-frontend:80)으로 라우팅 - DB는 내부 app-network 전용 유지 - 미사용이 된 BACKEND_PORT/FRONTEND_PORT 변수 제거 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
69 lines
1.8 KiB
YAML
69 lines
1.8 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: report-db
|
|
restart: always
|
|
environment:
|
|
POSTGRES_DB: ${DB_NAME:-report_db}
|
|
POSTGRES_USER: ${DB_USER:-postgres}
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:?DB_PASSWORD가 .env에 설정되어야 합니다}
|
|
expose:
|
|
- "5432"
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
networks:
|
|
- app-network
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-postgres} -d ${DB_NAME:-report_db}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 20
|
|
start_period: 30s
|
|
|
|
backend:
|
|
build: ./backend
|
|
container_name: report-backend
|
|
restart: always
|
|
expose:
|
|
- "3000"
|
|
environment:
|
|
- DB_HOST=${DB_HOST:-postgres}
|
|
- DB_PORT=${DB_PORT:-5432}
|
|
- DB_USER=${DB_USER:-postgres}
|
|
- DB_PASSWORD=${DB_PASSWORD:?DB_PASSWORD가 .env에 설정되어야 합니다}
|
|
- DB_NAME=${DB_NAME:-report_db}
|
|
- ACCESS_SECRET=${ACCESS_SECRET:?ACCESS_SECRET이 .env에 설정되어야 합니다}
|
|
- REFRESH_SECRET=${REFRESH_SECRET:?REFRESH_SECRET이 .env에 설정되어야 합니다}
|
|
- ADMIN_USER=${ADMIN_USER:?ADMIN_USER가 .env에 설정되어야 합니다}
|
|
- ADMIN_PASS=${ADMIN_PASS:?ADMIN_PASS가 .env에 설정되어야 합니다}
|
|
- JEMINI_KEY=${JEMINI_KEY}
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ./backend/img:/app/img
|
|
networks:
|
|
- app-network
|
|
- proxy
|
|
|
|
frontend:
|
|
build: ./frontend
|
|
container_name: report-frontend
|
|
restart: always
|
|
expose:
|
|
- "80"
|
|
depends_on:
|
|
- backend
|
|
networks:
|
|
- app-network
|
|
- proxy
|
|
|
|
networks:
|
|
app-network:
|
|
driver: bridge
|
|
# npm(Nginx Proxy Manager)이 컨테이너 이름으로 라우팅하는 공용 네트워크
|
|
proxy:
|
|
external: true
|
|
|
|
volumes:
|
|
postgres-data: |