# prefect-server development and testing # # usage: # docker compose up -d # start all services # docker compose up -d redis postgres # start dependencies only # docker compose up --build server # build and run server # docker compose run --rm test # run integration tests services: server: build: . ports: - "4200:4200" environment: PREFECT_SERVER_API_HOST: "0.0.0.0" PREFECT_SERVER_LOGGING_LEVEL: INFO PREFECT_DATABASE_BACKEND: ${PREFECT_DATABASE_BACKEND:-sqlite} PREFECT_DATABASE_URL: ${PREFECT_DATABASE_URL:-} PREFECT_BROKER_BACKEND: ${PREFECT_BROKER_BACKEND:-memory} PREFECT_REDIS_MESSAGING_HOST: ${PREFECT_REDIS_MESSAGING_HOST:-redis} depends_on: redis: condition: service_healthy required: false postgres: condition: service_healthy required: false healthcheck: test: ["CMD", "curl", "-f", "http://localhost:4200/api/health"] interval: 5s timeout: 3s retries: 3 redis: image: redis:7-alpine ports: - "6379:6379" healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 3 postgres: image: postgres:16-alpine ports: - "5432:5432" environment: POSTGRES_USER: prefect POSTGRES_PASSWORD: prefect POSTGRES_DB: prefect healthcheck: test: ["CMD-SHELL", "pg_isready -U prefect"] interval: 5s timeout: 3s retries: 3 # integration test runner test: image: python:3.12-slim working_dir: /tests volumes: - ./scripts:/tests:ro environment: PREFECT_API_URL: http://server:4200/api depends_on: server: condition: service_healthy entrypoint: ["sh", "-c"] command: ["pip install -q httpx rich && python test-api-sequence --json"]