-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
51 lines (51 loc) · 1.9 KB
/
Copy pathdocker-compose.yml
File metadata and controls
51 lines (51 loc) · 1.9 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
services:
bot:
build: .
# Preserve the historical bind-mount owner used by existing deployments.
# Fresh hosts may set APP_UID/APP_GID=10001 to match the image account.
user: "${APP_UID:-1000}:${APP_GID:-1000}"
init: true
env_file: .env
volumes:
- ./data:/app/data
# Legacy one-time import only; ignored after runtime_config is created.
- ./config.toml:/app/config.toml:ro
ports:
# Safe default for a reverse proxy on this host. Set
# MINIAPP_BIND_ADDRESS=0.0.0.0 only when another container/host must reach
# the backend directly and a firewall protects the port.
- "${MINIAPP_BIND_ADDRESS:-127.0.0.1}:${MINIAPP_LISTEN_PORT:-8480}:${MINIAPP_LISTEN_PORT:-8480}"
healthcheck:
test:
- CMD
- python
- -c
- >-
import os, urllib.request;
port = os.environ.get('MINIAPP_LISTEN_PORT', '8480');
urllib.request.urlopen(f'http://127.0.0.1:{port}/healthz', timeout=3).read()
interval: 30s
timeout: 5s
retries: 3
start_period: 60s
# Keep one bot from exhausting a small shared host. All limits are
# overrideable for larger deployments without editing this file.
mem_limit: "${BOT_MEMORY_LIMIT:-1536m}"
memswap_limit: "${BOT_MEMORY_SWAP_LIMIT:-1536m}"
mem_reservation: "${BOT_MEMORY_RESERVATION:-256m}"
cpus: "${BOT_CPU_LIMIT:-2.0}"
pids_limit: ${BOT_PIDS_LIMIT:-128}
ulimits:
nofile:
soft: 8192
hard: 8192
logging:
driver: local
options:
max-size: "${BOT_LOG_MAX_SIZE:-10m}"
max-file: "${BOT_LOG_MAX_FILES:-5}"
# The application drains durable updates, replies and cleanup jobs in a
# bounded sequence; Docker's 10-second default would SIGKILL it mid-drain.
# Must remain above the application's 110-second hard shutdown watchdog.
stop_grace_period: 125s
restart: unless-stopped