services: assistant: build: . container_name: telegram-assistant restart: unless-stopped # root by default, like older versions, so an existing ./data keeps working after `git pull`. # To run as an unprivileged user see "Running the container without root" in the README. user: "${APP_UID:-0}:${APP_GID:-0}" security_opt: - no-new-privileges:true cap_drop: - ALL # root without these could not write to a ./data owned by another uid (a restored backup, a folder # made by hand); everything else root normally gets in a container is dropped. # Not needed and can be removed when APP_UID is set. cap_add: - CHOWN - DAC_OVERRIDE - FOWNER env_file: - .env environment: # переопределяем путь к БД, чтобы лежал в смонтированном томе DATABASE_URL: sqlite+aiosqlite:////app/data/app.db TZ: UTC volumes: - ./data:/app/data # лог-ротация, чтобы не разрастался диск logging: driver: json-file options: max-size: "10m" max-file: "5"