-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose-prod.yml
More file actions
90 lines (83 loc) · 2.91 KB
/
Copy pathdocker-compose-prod.yml
File metadata and controls
90 lines (83 loc) · 2.91 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
services:
php:
image: ${DOCKER_IMAGE:-starter}:${TAG:-latest}
environment:
APP_ENV: prod
APP_SECRET: "${APP_SECRET}"
SERVER_NAME: ":80"
TZ: Europe/Paris
DATABASE_URL: "postgresql://starter:${DB_PASSWORD}@starter_db:5432/starter?serverVersion=18&charset=utf8"
deploy:
replicas: 1
update_config:
order: stop-first
parallelism: 1
monitor: 30s
failure_action: rollback
max_failure_ratio: 0
rollback_config:
parallelism: 1
order: stop-first
labels:
- traefik.enable=true
- traefik.http.services.starter.loadbalancer.server.port=80
- traefik.http.routers.starter.rule=Host(`starter.example.com`)
- traefik.http.routers.starter.entrypoints=http
- traefik.http.routers.starter.middlewares=tls-redirectscheme
- traefik.http.routers.starter-secure.rule=Host(`starter.example.com`)
- traefik.http.routers.starter-secure.entrypoints=https
- traefik.http.routers.starter-secure.tls=true
- traefik.http.routers.starter-secure.tls.certresolver=letsencrypt
networks:
- traefik_traefik_proxy
- starter_internal
message_worker:
image: ${DOCKER_IMAGE:-starter}-worker:${TAG:-latest}
environment:
APP_ENV: prod
APP_SECRET: "${APP_SECRET}"
TZ: Europe/Paris
DATABASE_URL: "postgresql://starter:${DB_PASSWORD}@starter_db:5432/starter?serverVersion=18&charset=utf8"
stop_grace_period: 60s
deploy:
replicas: 1
update_config:
order: stop-first
parallelism: 1
monitor: 30s
failure_action: rollback
resources:
limits:
memory: 1G
networks:
- starter_internal
db:
image: postgres:18
environment:
POSTGRES_USER: starter
POSTGRES_PASSWORD: "${DB_PASSWORD}"
POSTGRES_DB: starter
TZ: Europe/Paris
PGTZ: Europe/Paris
volumes:
- starter_db_data:/var/lib/postgresql:rw
# Host path for `make db.backup` (pg_dump writes to /backups inside the container)
- /srv/starter/backups:/backups
healthcheck:
test: ["CMD-SHELL", "pg_isready -U starter"]
interval: 10s
timeout: 5s
retries: 5
deploy:
replicas: 1
update_config:
order: stop-first
networks:
- starter_internal
volumes:
starter_db_data:
networks:
traefik_traefik_proxy:
external: true
starter_internal:
driver: overlay