prefect server in zig
1# prefect-server development and testing
2#
3# usage:
4# docker compose up -d # start all services
5# docker compose up -d redis postgres # start dependencies only
6# docker compose up --build server # build and run server
7# docker compose run --rm test # run integration tests
8
9services:
10 server:
11 build: .
12 ports:
13 - "4200:4200"
14 environment:
15 PREFECT_SERVER_API_HOST: "0.0.0.0"
16 PREFECT_SERVER_LOGGING_LEVEL: INFO
17 PREFECT_DATABASE_BACKEND: ${PREFECT_DATABASE_BACKEND:-sqlite}
18 PREFECT_DATABASE_URL: ${PREFECT_DATABASE_URL:-}
19 PREFECT_BROKER_BACKEND: ${PREFECT_BROKER_BACKEND:-memory}
20 PREFECT_REDIS_MESSAGING_HOST: ${PREFECT_REDIS_MESSAGING_HOST:-redis}
21 depends_on:
22 redis:
23 condition: service_healthy
24 required: false
25 postgres:
26 condition: service_healthy
27 required: false
28 healthcheck:
29 test: ["CMD", "curl", "-f", "http://localhost:4200/api/health"]
30 interval: 5s
31 timeout: 3s
32 retries: 3
33
34 redis:
35 image: redis:7-alpine
36 ports:
37 - "6379:6379"
38 healthcheck:
39 test: ["CMD", "redis-cli", "ping"]
40 interval: 5s
41 timeout: 3s
42 retries: 3
43
44 postgres:
45 image: postgres:16-alpine
46 ports:
47 - "5432:5432"
48 environment:
49 POSTGRES_USER: prefect
50 POSTGRES_PASSWORD: prefect
51 POSTGRES_DB: prefect
52 healthcheck:
53 test: ["CMD-SHELL", "pg_isready -U prefect"]
54 interval: 5s
55 timeout: 3s
56 retries: 3
57
58 # integration test runner
59 test:
60 image: python:3.12-slim
61 working_dir: /tests
62 volumes:
63 - ./scripts:/tests:ro
64 environment:
65 PREFECT_API_URL: http://server:4200/api
66 depends_on:
67 server:
68 condition: service_healthy
69 entrypoint: ["sh", "-c"]
70 command: ["pip install -q httpx rich && python test-api-sequence --json"]