-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
45 lines (45 loc) · 1.01 KB
/
docker-compose.yml
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
version: '3'
services:
db:
image: postgres:15
networks:
- civviebot_db
env_file: .env
volumes:
- db_data:/var/lib/postgresql/data/
# Pre-loading tables as CREATE IF NOT EXISTS is susceptible to race
# conditions that could be triggered by spinning up the API and bot at
# the same time.
- database/sql/tables.sql:/docker-entrypoint-initdb.d/tables.sql
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 10
api:
image: civviebot
command: ['python', '-m', 'gunicorn', '-b', '0.0.0.0:3002', 'civviebot_api:civviebot_api']
expose:
- 80
ports:
- 80:3002
networks:
- civviebot_db
env_file: .env
depends_on:
- db
bot:
image: civviebot
command: ['python', 'civviebot.py']
networks:
- civviebot_db
env_file: .env
depends_on:
- db
networks:
civviebot_db:
external: false
volumes:
db_data: