forked from roilead/tgbot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
62 lines (59 loc) · 1.41 KB
/
Copy pathdocker-compose.yml
File metadata and controls
62 lines (59 loc) · 1.41 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
services:
bot:
build:
context: .
dockerfile: Dockerfile
ports:
- "${WEBHOOK__PORT:-8080}:${WEBHOOK__PORT:-8080}"
env_file:
- .env
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import sys; sys.exit(0)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
db:
image: postgres:15-alpine
ports:
- "${DB__PORT:-5434}:5432"
volumes:
- db_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${DB__USER}
POSTGRES_PASSWORD: ${DB__PASSWORD}
POSTGRES_DB: ${DB__NAME}
DB__HOST: ${DB__HOST}
DB__PORT: ${DB__PORT}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB__USER:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
redis:
image: redis:7-alpine
ports:
- "${REDIS__PORT:-6434}:6379"
volumes:
- redis_data:/data
environment:
REDIS_PASSWORD: ${REDIS__PASSWORD}
REDIS__HOST: ${REDIS__HOST}
REDIS__PORT: ${REDIS__PORT}
REDIS__DB: ${REDIS__DB}
command: redis-server --requirepass ${REDIS__PASSWORD}
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS__PASSWORD}", "ping"]
interval: 5s
timeout: 3s
retries: 5
start_period: 5s
volumes:
db_data:
redis_data: