services: api: build: . container_name: ip-geo-api restart: unless-stopped ports: - "${PORT:-8080}:${PORT}" healthcheck: test: [ "CMD", "python", "-c", "import urllib.request; import sys; req = urllib.request.Request('http://localhost:${PORT}/health'); sys.exit(0) if urllib.request.urlopen(req).read() == b'OK' else sys.exit(1)", ] interval: 30s timeout: 10s retries: 3 start_period: 10s command: [ "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "${PORT}", "--log-config", "logging.yml", "--proxy-headers", "--forwarded-allow-ips=*", ] volumes: - ./data:/data env_file: - .env networks: - ip-geo-api_network depends_on: - updater updater: build: . container_name: ip-geo-updater restart: unless-stopped volumes: - ./data:/data command: ["python", "-m", "scripts.updater"] environment: - PYTHONPATH=/app env_file: - .env networks: ip-geo-api_network: driver: bridge