Skip to content

Instantly share code, notes, and snippets.

@ArthurDelannoyazerty
Last active August 21, 2025 09:59
Show Gist options
  • Save ArthurDelannoyazerty/8f4dad24511d961051180853c407e6fb to your computer and use it in GitHub Desktop.
Save ArthurDelannoyazerty/8f4dad24511d961051180853c407e6fb to your computer and use it in GitHub Desktop.
Do not use the given URL (like a `0.0.0.0`) but use the serrver URL for fast loading
name: compose-name
services:
# -------------------------------------------------------------------------- #
# PREFECT #
# -------------------------------------------------------------------------- #
postgres-prefect:
image: postgres:14
environment:
POSTGRES_USER: prefect
POSTGRES_PASSWORD: prefect
POSTGRES_DB: prefect
volumes:
- ./docker/volume/postgres_prefect:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U prefect"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7
volumes:
- ./docker/volume/redis:/data
healthcheck:
test: ["CMD-SHELL", "redis-cli ping"]
interval: 5s
timeout: 5s
retries: 5
prefect-server:
image: prefecthq/prefect:3-latest
depends_on:
postgres-prefect:
condition: service_healthy
redis:
condition: service_healthy
environment:
PREFECT_SERVER_ANALYTICS_ENABLED: false
PREFECT_UI_API_URL: http://${HOSTNAME:-localhost}:4200/api
PREFECT_API_DATABASE_CONNECTION_URL: postgresql+asyncpg://prefect:prefect@postgres-prefect:5432/prefect
PREFECT_SERVER_API_HOST: 0.0.0.0
PREFECT_MESSAGING_BROKER: prefect_redis.messaging
PREFECT_MESSAGING_CACHE: prefect_redis.messaging
PREFECT_REDIS_MESSAGING_HOST: redis
PREFECT_REDIS_MESSAGING_PORT: 6379
PREFECT_REDIS_MESSAGING_DB: 0
command: prefect server start
ports:
- "4200:4200"
prefect-worker:
image: prefecthq/prefect:3-latest
depends_on:
prefect-server:
condition: service_started
environment:
PREFECT_API_URL: http://prefect-server:4200/api
command: prefect worker start --pool local-pool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment