-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
64 lines (58 loc) · 1.42 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
services:
bot_db:
image: postgres:latest
restart: always
container_name: bot_db
user: root
privileged: true
env_file: .env
environment:
TZ: UTC
POSTGRES_USER: ${POSTGRESQL_USER}
PGUSER: ${POSTGRESQL_USER}
POSTGRES_PASSWORD: ${POSTGRESQL_PASSWORD}
POSTGRES_DB: ${POSTGRESQL_DATABASE}
volumes:
- bot_db_data:/var/lib/postgresql/data:rw
ports:
- ${POSTGRESQL_PORT}:${POSTGRESQL_PORT}
expose:
- ${POSTGRESQL_PORT}/tcp
healthcheck:
test: ["CMD-SHELL", "sh -c 'pg_isready -U ${POSTGRESQL_USER} -d ${POSTGRESQL_DATABASE}'"]
retries: 5
interval: 10s
timeout: 10s
start_period: 10s
bot_alembic:
build:
context: .
dockerfile: Dockerfile
container_name: bot_alembic
restart: on-failure:5
user: root
privileged: true
env_file: .env
depends_on:
bot_db:
condition: service_healthy
command: ["poetry", "run", "alembic", "-c", "config/alembic.ini", "upgrade", "head"]
bot:
build:
context: .
dockerfile: Dockerfile
args:
- LOG_DIRECTORY=${LOG_DIRECTORY}
container_name: bot
restart: always
user: root
privileged: true
env_file: .env
volumes:
- ${LOG_DIRECTORY}:${LOG_DIRECTORY}
depends_on:
- bot_alembic
command: ["python", "/app/bot.py"]
volumes:
bot_db_data:
name: "bot_db_data"