packlist/docker-compose.prod.yml

58 lines
1.2 KiB
YAML

networks:
nginx-proxy:
external: true
name: nginx-proxy
services:
packlist-db:
image: postgres:15-alpine
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
expose:
- "5432"
volumes:
- db_data:/var/lib/postgresql/data
networks:
- nginx-proxy
packlist-backend:
build:
context: ./backend
dockerfile: Dockerfile
target: prod
depends_on:
- packlist-db
expose:
- "8000"
environment:
- PYTHONUNBUFFERED=1
command: ["gunicorn", "--bind", "0.0.0.0:8000", "-k", "uvicorn.workers.UvicornWorker", "main:app"]
networks:
- nginx-proxy
packlist-frontend:
build:
context: ./frontend
dockerfile: Dockerfile
target: prod
expose:
- "80"
environment:
- NODE_ENV=production
- VITE_API_URL=/api
command: ["serve", "-s", "dist", "-l", "80"]
networks:
- nginx-proxy
nginx:
image: nginx:alpine
expose:
- "80"
volumes:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- packlist-frontend
- packlist-backend
networks:
- nginx-proxy
volumes:
db_data: