-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
34 lines (32 loc) · 861 Bytes
/
docker-compose.yml
File metadata and controls
34 lines (32 loc) · 861 Bytes
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
# Production Docker Swarm stack — Python FastAPI app
# Usage: TAG=v1 docker stack deploy -c docker-compose.yml myapp
services:
app:
image: ${REGISTRY:-registry.local}/python-app:${TAG:-latest}
secrets:
- database_url
- secret_key
entrypoint: ["/app/entrypoint.sh"]
command: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "2"]
environment:
DEPLOYMENT: production
PORT: "8000"
APP_DOMAIN: ${APP_DOMAIN:-localhost}
deploy:
labels:
caddy: ${APP_DOMAIN:-localhost}
caddy.reverse_proxy: "{{upstreams 8000}}"
replicas: 1
update_config:
parallelism: 1
delay: 10s
order: start-first
volumes:
- appdata:/app/data
secrets:
database_url:
external: true
secret_key:
external: true
volumes:
appdata: