-
Notifications
You must be signed in to change notification settings - Fork 7
/
compose.prod.yaml
99 lines (99 loc) · 2.55 KB
/
compose.prod.yaml
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
91
92
93
94
95
96
97
98
99
services:
reverse-proxy:
image: traefik:v3.1
command:
- "--api.insecure=true"
- "--providers.docker"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "${PORT}:80"
- "8080:8080"
volumes:
- letsencrypt:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock
whombat:
build:
context: .
volumes:
- ${AUDIO_DIR}:/audio
env_file:
- .env
environment:
- WHOMBAT_DB_DIALECT=postgresql
- WHOMBAT_DB_USERNAME=${POSTGRES_USER?Variable not set}
- WHOMBAT_DB_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
- WHOMBAT_DB_NAME=${POSTGRES_DB?Variable not set}
- WHOMBAT_DB_URL=
- WHOMBAT_DB_HOST=db
- WHOMBAT_DB_PORT=5432
- WHOMBAT_HOST=0.0.0.0
- WHOMBAT_PORT=5000
- WHOMBAT_AUDIO_DIR=/audio
deploy:
mode: replicated
replicas: 3
restart: always
labels:
- "traefik.enable=true"
- "traefik.http.routers.whombat.rule=Host(`${DOMAIN?Variable not set}`)"
- "traefik.http.routers.whombat.entrypoints=web"
- "traefik.http.services.whombat.loadbalancer.server.port=5000"
- "traefik.http.middlewares.testheader.headers.accesscontrolallowheaders=*"
depends_on:
db:
condition: service_healthy
prestart:
condition: service_completed_successfully
networks:
- public
- private
prestart:
build:
context: .
networks:
- private
depends_on:
db:
condition: service_healthy
command: alembic upgrade head
env_file:
- .env
environment:
- WHOMBAT_DB_DIALECT=postgresql
- WHOMBAT_DB_USERNAME=${POSTGRES_USER?Variable not set}
- WHOMBAT_DB_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
- WHOMBAT_DB_NAME=${POSTGRES_DB?Variable not set}
- WHOMBAT_DB_URL=
- WHOMBAT_DB_HOST=db
- WHOMBAT_DB_PORT=5432
- WHOMBAT_HOST=0.0.0.0
- WHOMBAT_PORT=5000
- WHOMBAT_AUDIO_DIR=/audio
db:
image: postgres
restart: always
user: postgres
volumes:
- db-data:/var/lib/postgresql/data
env_file:
- .env
environment:
- POSTGRES_DB=${POSTGRES_DB?Variable not set}
- POSTGRES_USER=${POSTGRES_USER?Variable not set}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
expose:
- 5432
healthcheck:
test: ["CMD", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
networks:
- private
volumes:
db-data:
letsencrypt:
networks:
public:
private: