services: redis: image: redis:7-alpine ports: ["6379:6379"] command: redis-server --save "" --appendonly no python-proxy: build: . ports: ["8000:8000"] environment: # overridable so the legacy profile below can repoint it without editing this file UPSTREAM_SIMPLE_URL: "${UPSTREAM_SIMPLE_URL:-https://pypi.org/simple}" UPSTREAM_FILES_URL: "${UPSTREAM_FILES_URL:-https://files.pythonhosted.org}" ARTIFACT_HOST_ALLOWLIST: "${ARTIFACT_HOST_ALLOWLIST:-}" REWRITE_ARTIFACT_URLS: "${REWRITE_ARTIFACT_URLS:-true}" REDIS_URL: "redis://redis:6379/0" CACHE_BACKEND: "redis" CACHE_TTL_SECONDS: "300" ENABLE_BACKGROUND_METADATA: "${ENABLE_BACKGROUND_METADATA:-false}" METADATA_PENDING_CACHE_TTL_SECONDS: "${METADATA_PENDING_CACHE_TTL_SECONDS:-30}" METADATA_BACKGROUND_DISCOVERY_IDLE_SECONDS: "${METADATA_BACKGROUND_DISCOVERY_IDLE_SECONDS:-90}" METADATA_BACKGROUND_EXTRACTION_IDLE_SECONDS: "${METADATA_BACKGROUND_EXTRACTION_IDLE_SECONDS:-90}" # Extract through nginx so range reads populate/share the artifact cache. METADATA_ARTIFACT_BASE_URL: "http://nginx" depends_on: [redis] healthcheck: test: ["CMD", "python", "-c", "import httpx; print(httpx.get('http://localhost:8000/health', timeout=2).text)"] interval: 10s retries: 5 nginx: image: nginx:alpine ports: ["8080:80"] volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro depends_on: [python-proxy] # legacy upstream simulator (HTML-only Simple tree under tests/fixtures) # run with: # UPSTREAM_SIMPLE_URL=http://legacy-simple:9000/simple docker compose --profile legacy up -d legacy-simple: profiles: ["legacy"] image: python:3.11-slim working_dir: /data command: python -m http.server 9000 --directory /data volumes: - ./tests/fixtures:/data:ro ports: ["9000:9000"]