services: web: build: context: . env_file: - .env ports: - "${APP_HOST_PORT:-8000}:${APP_PORT:-8000}" restart: unless-stopped init: true stop_grace_period: 30s volumes: - ./instance:/app/instance healthcheck: test: - CMD-SHELL - > python -c "import os, urllib.request; urllib.request.urlopen( 'http://127.0.0.1:' + os.getenv('APP_PORT', '8000') + '/health', timeout=5)" interval: 30s timeout: 6s retries: 3 start_period: 20s