mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 19:14:03 +00:00
66 lines
1.7 KiB
YAML
66 lines
1.7 KiB
YAML
services:
|
|
bot:
|
|
image: ${BOT_IMAGE:?set BOT_IMAGE}
|
|
restart: unless-stopped
|
|
env_file:
|
|
- ${ENV_DIR:-/opt/household-bot/env}/bot.env
|
|
healthcheck:
|
|
test: ['CMD', 'bun', '-e', "fetch('http://127.0.0.1:' + (process.env.PORT ?? '8080') + '/healthz').then((res) => process.exit(res.ok ? 0 : 1)).catch(() => process.exit(1))"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 15s
|
|
|
|
miniapp:
|
|
image: ${MINIAPP_IMAGE:?set MINIAPP_IMAGE}
|
|
restart: unless-stopped
|
|
env_file:
|
|
- ${ENV_DIR:-/opt/household-bot/env}/miniapp.env
|
|
depends_on:
|
|
bot:
|
|
condition: service_healthy
|
|
|
|
scheduler:
|
|
image: ${BOT_IMAGE:?set BOT_IMAGE}
|
|
restart: unless-stopped
|
|
command: ['bun', 'apps/bot/dist/scheduler-runner.js']
|
|
env_file:
|
|
- ${ENV_DIR:-/opt/household-bot/env}/bot.env
|
|
environment:
|
|
BOT_INTERNAL_BASE_URL: http://bot:8080
|
|
SCHEDULER_POLL_INTERVAL_MS: ${SCHEDULER_POLL_INTERVAL_MS:-60000}
|
|
SCHEDULER_DUE_SCAN_LIMIT: ${SCHEDULER_DUE_SCAN_LIMIT:-25}
|
|
depends_on:
|
|
bot:
|
|
condition: service_healthy
|
|
|
|
migrate:
|
|
image: ${BOT_IMAGE:?set BOT_IMAGE}
|
|
profiles: ['ops']
|
|
env_file:
|
|
- ${ENV_DIR:-/opt/household-bot/env}/bot.env
|
|
command: ['bun', 'packages/db/dist/migrate.js']
|
|
restart: 'no'
|
|
|
|
caddy:
|
|
image: caddy:2.8-alpine
|
|
restart: unless-stopped
|
|
env_file:
|
|
- ${ENV_DIR:-/opt/household-bot/env}/caddy.env
|
|
depends_on:
|
|
bot:
|
|
condition: service_healthy
|
|
miniapp:
|
|
condition: service_started
|
|
ports:
|
|
- '80:80'
|
|
- '443:443'
|
|
volumes:
|
|
- ./Caddyfile:/etc/caddy/Caddyfile:ro
|
|
- caddy_data:/data
|
|
- caddy_config:/config
|
|
|
|
volumes:
|
|
caddy_data:
|
|
caddy_config:
|