-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
57 lines (56 loc) · 1.34 KB
/
docker-compose.yml
File metadata and controls
57 lines (56 loc) · 1.34 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
services:
bot:
# build: .
image: ghcr.io/sudo-py-dev/lex-tg:latest
container_name: lex-tg
restart: unless-stopped
env_file:
- .env
volumes:
- ./sessions:/app/sessions
- ./logs:/app/logs
- ./data:/app/data
environment:
- DATABASE_URL=${DATABASE_URL}
depends_on:
db:
condition: service_healthy
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
read_only: true
tmpfs:
- /tmp
healthcheck:
test: ["CMD-SHELL", "test -f /app/data/heartbeat && test $$(($$(date +%s) - $$(cat /app/data/heartbeat))) -lt 120"]
interval: 60s
timeout: 5s
retries: 3
start_period: 60s
deploy:
resources:
limits:
memory: 512M
reservations:
memory: 128M
db:
image: postgres:16-alpine
container_name: lex-tg-db
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER:-bot}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-bot_password}
POSTGRES_DB: ${POSTGRES_DB:-botdb}
volumes:
- ./pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 5s
timeout: 5s
retries: 5