-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
61 lines (56 loc) · 1.34 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
version: '2.4'
services:
bot:
image: "${BOT_IMAGE_NAME:-tg_bot-image}"
container_name: "${BOT_CONTAINER_NAME:-tg_bot-container}"
stop_signal: SIGINT
build:
context: .
working_dir: "/usr/src/app/${BOT_NAME:-tg_bot}"
volumes:
- .:/usr/src/app/${BOT_NAME:-tg_bot}
command: bash -c "alembic upgrade head && python3 -m bot"
restart: always
env_file:
- ".env"
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
networks:
- tg_bot
db:
container_name: "${DB_CONTAINER_NAME:-db-container}"
image: postgres:14
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASS}
- POSTGRES_DB=${DB_NAME}
restart: always
ports:
- "${DB_EXPOSE_PORT:-5432}:5432"
networks:
- tg_bot
volumes:
- postgres:/var/lib/postgresql/data
healthcheck:
test: [ "CMD", "pg_isready", "-U", "${DB_USER}", "-d", "${DB_NAME}" ]
interval: 1s
timeout: 3s
retries: 5
redis:
container_name: "${REDIS_CONTAINER_NAME:-redis-container}"
image: redis:alpine
command: "redis-server --requirepass ${REDIS_PASS:-password123}"
restart: always
networks:
- tg_bot
volumes:
- redis:/data
networks:
tg_bot:
driver: bridge
volumes:
postgres:
redis: