46 lines
923 B
YAML
46 lines
923 B
YAML
services:
|
|
postgres:
|
|
image: postgres:16
|
|
ports:
|
|
- "5432:5432"
|
|
environment:
|
|
POSTGRES_USER: ${DB_USERNAME}
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
|
POSTGRES_DB: ${DB_NAME}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME} -d ${DB_NAME}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
ports:
|
|
- "3000:3000"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
SEED_ON_BOOT: "false"
|
|
command: sh ./scripts/start-prod.sh
|
|
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
ports:
|
|
- "3001:3001"
|
|
depends_on:
|
|
- backend
|
|
environment:
|
|
BACKEND_URL: http://backend:3000/api
|
|
NODE_ENV: production
|
|
command: sh -c "npm run start"
|
|
|
|
volumes:
|
|
postgres_data:
|