-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
executable file
·60 lines (56 loc) · 1.24 KB
/
docker-compose.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
version: '3.9'
services:
app:
container_name: test-bot
image: ${IMAGE_ID}
pull_policy: always
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
environment:
TG_TOKEN: ${TG_TOKEN}
WEBHOOK_URL: ${WEBHOOK_URL}
WEBHOOK_PORT: ${WEBHOOK_PORT}
PG_DSN: ${PG_DSN}
networks:
- backend
ports:
- ${WEBHOOK_PORT}:${WEBHOOK_PORT}
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 20s
postgres:
image: postgres:16.2-alpine3.19
container_name: bot-postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${PG_DB}
POSTGRES_USER: ${PG_USER}
POSTGRES_PASSWORD: ${PG_PASSWORD}
PGDATA: "/var/lib/postgresql/data/pgdata"
volumes:
- test-bot_postgres:/var/lib/postgresql/data
networks:
- backend
ports:
- ${PG_PORT}:5432
healthcheck:
test: ["CMD-SHELL", 'pg_isready -U ${PG_USER} -d ${PG_DB}']
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
deploy:
resources:
limits:
cpus: '1'
memory: 4G
volumes:
test-bot_postgres:
networks:
backend:
driver: bridge