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