Files
PolyWeather/docker-compose.yml
T

40 lines
1.2 KiB
YAML

x-polyweather-base: &polyweather-base
build: .
image: polyweather-app:latest
env_file:
- .env
services:
polyweather:
<<: *polyweather-base
container_name: polyweather_bot
restart: unless-stopped
volumes:
- ${POLYWEATHER_RUNTIME_DATA_DIR:-/var/lib/polyweather}:/var/lib/polyweather
- ${POLYWEATHER_RUNTIME_DATA_DIR:-/var/lib/polyweather}:/app/data
- ./bot.log:/app/bot.log
user: "${UID:-1000}:${GID:-1000}"
healthcheck:
test: ["CMD", "python", "-c", "import sqlite3; c=sqlite3.connect('/var/lib/polyweather/polyweather.db'); c.execute('SELECT 1'); c.close()"]
interval: 60s
timeout: 10s
retries: 3
polyweather_web:
<<: *polyweather-base
container_name: polyweather_web
restart: unless-stopped
command: python web/app.py
volumes:
- ${POLYWEATHER_RUNTIME_DATA_DIR:-/var/lib/polyweather}:/var/lib/polyweather
- ${POLYWEATHER_RUNTIME_DATA_DIR:-/var/lib/polyweather}:/app/data
ports:
- "127.0.0.1:8000:8000"
user: "${UID:-1000}:${GID:-1000}"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/healthz"]
interval: 30s
timeout: 5s
retries: 3