diff --git a/blueprints/prefect/docker-compose.yml b/blueprints/prefect/docker-compose.yml new file mode 100644 index 00000000..242936e8 --- /dev/null +++ b/blueprints/prefect/docker-compose.yml @@ -0,0 +1,90 @@ +version: "3.8" + +services: + prefect: + image: prefecthq/prefect:3.7.5-python3.12 + restart: unless-stopped + depends_on: + prefect-postgres: + condition: service_healthy + prefect-redis: + condition: service_healthy + environment: + - PREFECT_API_DATABASE_CONNECTION_URL=postgresql+asyncpg://prefect:${POSTGRES_PASSWORD}@prefect-postgres:5432/prefect + - PREFECT_SERVER_API_HOST=0.0.0.0 + - PREFECT_SERVER_UI_API_URL=https://${PREFECT_DOMAIN}/api + - PREFECT_MESSAGING_BROKER=prefect_redis.messaging + - PREFECT_MESSAGING_CACHE=prefect_redis.messaging + - PREFECT_REDIS_MESSAGING_HOST=prefect-redis + - PREFECT_REDIS_MESSAGING_PORT=6379 + - PREFECT_REDIS_MESSAGING_DB=0 + command: prefect server start --no-services + expose: + - 4200 + healthcheck: + test: + [ + "CMD", + "python", + "-c", + "import urllib.request as u; u.urlopen('http://localhost:4200/api/health', timeout=1)", + ] + interval: 30s + timeout: 10s + retries: 3 + start_period: 60s + + prefect-services: + image: prefecthq/prefect:3.7.5-python3.12 + restart: unless-stopped + depends_on: + prefect: + condition: service_healthy + environment: + - PREFECT_API_DATABASE_CONNECTION_URL=postgresql+asyncpg://prefect:${POSTGRES_PASSWORD}@prefect-postgres:5432/prefect + - PREFECT_MESSAGING_BROKER=prefect_redis.messaging + - PREFECT_MESSAGING_CACHE=prefect_redis.messaging + - PREFECT_REDIS_MESSAGING_HOST=prefect-redis + - PREFECT_REDIS_MESSAGING_PORT=6379 + - PREFECT_REDIS_MESSAGING_DB=0 + command: prefect server services start + + prefect-worker: + image: prefecthq/prefect:3.7.5-python3.12 + restart: unless-stopped + depends_on: + prefect: + condition: service_healthy + environment: + - PREFECT_API_URL=http://prefect:4200/api + command: prefect worker start --pool local-pool + + prefect-postgres: + image: postgres:14-alpine + restart: unless-stopped + environment: + - POSTGRES_USER=prefect + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + - POSTGRES_DB=prefect + volumes: + - prefect-postgres-data:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U prefect -d prefect"] + interval: 5s + timeout: 5s + retries: 5 + + prefect-redis: + image: redis:7.2-alpine + restart: unless-stopped + volumes: + - prefect-redis-data:/data + healthcheck: + test: ["CMD", "redis-cli", "ping"] + interval: 5s + timeout: 5s + retries: 5 + +volumes: + prefect-postgres-data: + prefect-redis-data: diff --git a/blueprints/prefect/prefect.svg b/blueprints/prefect/prefect.svg new file mode 100644 index 00000000..07bf5b43 --- /dev/null +++ b/blueprints/prefect/prefect.svg @@ -0,0 +1,7 @@ + + Prefect + Prefect template icon + + + + diff --git a/blueprints/prefect/template.toml b/blueprints/prefect/template.toml new file mode 100644 index 00000000..15f166e5 --- /dev/null +++ b/blueprints/prefect/template.toml @@ -0,0 +1,15 @@ +[variables] +main_domain = "${domain}" +postgres_password = "${password:32}" + +[config] +env = [ + "PREFECT_DOMAIN=${main_domain}", + "POSTGRES_PASSWORD=${postgres_password}", +] +mounts = [] + +[[config.domains]] +serviceName = "prefect" +port = 4200 +host = "${main_domain}" diff --git a/meta.json b/meta.json index c8a04988..2e6eaefb 100644 --- a/meta.json +++ b/meta.json @@ -5689,6 +5689,23 @@ ], "dokploy_version": "<0.22.5" }, + { + "id": "prefect", + "name": "Prefect", + "version": "3.7.5-python3.12", + "description": "Prefect is an open-source workflow orchestration platform for building, scheduling, monitoring, and managing data pipelines and Python workflows.", + "logo": "prefect.svg", + "links": { + "github": "https://github.com/PrefectHQ/prefect", + "website": "https://www.prefect.io/", + "docs": "https://docs.prefect.io/" + }, + "tags": [ + "automation", + "workflow", + "data" + ] + }, { "id": "privatebin", "name": "PrivateBin",