33 lines
893 B
YAML
33 lines
893 B
YAML
services:
|
|
app:
|
|
build: .
|
|
image: orderlist-app:latest
|
|
container_name: orderlist-app
|
|
restart: unless-stopped
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
# .env에 적힌 값이 컨테이너에서 그대로 보입니다.
|
|
# 컨테이너 내부에서 DB_HOST는 반드시 postgres-db 여야 합니다.
|
|
DB_HOST: ${DB_HOST:-postgres-db}
|
|
ports:
|
|
- "8000:8000"
|
|
networks:
|
|
- postgres_net
|
|
- default
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-fsS", "http://localhost:8000/health/db"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 20s
|
|
|
|
networks:
|
|
# 이미 운영 중인 postgres-db 컨테이너가 속해 있는 외부 네트워크에
|
|
# 그대로 attach 합니다. (compose가 새로 만들지 않음)
|
|
postgres_net:
|
|
external: true
|
|
name: ${POSTGRES_NETWORK:-postgres-net}
|
|
default:
|
|
driver: bridge
|