packlist/docker-compose.prod.yml

77 lines
1.7 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
- packlist-liquibase
expose:
- "8000"
environment:
- PYTHONUNBUFFERED=1
- LIQUIBASE_WAIT_TIMEOUT=60 # increase timeout to 60s
networks:
- nginx-proxy
packlist-liquibase:
image: liquibase/liquibase:latest
depends_on:
- packlist-db
volumes:
- ./backend/db/changelog:/liquibase/changelog:ro
- ./backend/db/lib:/liquibase/lib:ro
command: >
--log-level=debug
--changeLogFile=db.changelog-master.yaml
--url=jdbc:postgresql://packlist-db:5432/postgres
--username=postgres
--password=postgres
update
restart: "no"
networks:
- nginx-proxy
packlist-frontend:
build:
context: ./frontend
dockerfile: Dockerfile
target: prod
args:
VITE_API_URL: /api
expose:
- "80"
environment:
- NODE_ENV=production
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: