-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
42 lines (39 loc) · 1 KB
/
docker-compose.prod.yml
File metadata and controls
42 lines (39 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
version: "3.9"
services:
app:
build:
context: .
dockerfile: docker/Dockerfile
container_name: api_app_prod
env_file: .env
depends_on:
db:
condition: service_healthy
command: bash -c "alembic upgrade head && gunicorn -k uvicorn.workers.UvicornWorker app.main:app -w 4 -b 0.0.0.0:8000 --timeout 90"
working_dir: /code
ports:
- "8000:8000"
environment:
ENVIRONMENT: production
restart: unless-stopped
volumes:
- static_data:/code/static # opcional se futuramente servir arquivos estáticos
db:
image: postgres:15
container_name: api_db_prod
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- db_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
volumes:
db_data:
static_data: