Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions blueprints/prefect/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,17 @@ services:
- PREFECT_REDIS_MESSAGING_HOST=prefect-redis
- PREFECT_REDIS_MESSAGING_PORT=6379
- PREFECT_REDIS_MESSAGING_DB=0
command: prefect server start --no-services
- USE_AUTH=${USE_AUTH:-False}
- PREFECT_AUTH_USER=${PREFECT_AUTH_USER}
- PREFECT_AUTH_PASSWORD=${PREFECT_AUTH_PASSWORD}
command:
- sh
- -c
- |
case "$$USE_AUTH" in
[Tt]rue|1|[Yy]es) export PREFECT_SERVER_API_AUTH_STRING="$$PREFECT_AUTH_USER:$$PREFECT_AUTH_PASSWORD"; export PREFECT_API_AUTH_STRING="$$PREFECT_AUTH_USER:$$PREFECT_AUTH_PASSWORD"; echo "Prefect basic auth enabled" ;;
esac
exec prefect server start --no-services
expose:
- 4200
healthcheck:
Expand Down Expand Up @@ -47,7 +57,17 @@ services:
- PREFECT_REDIS_MESSAGING_HOST=prefect-redis
- PREFECT_REDIS_MESSAGING_PORT=6379
- PREFECT_REDIS_MESSAGING_DB=0
command: prefect server services start
- USE_AUTH=${USE_AUTH:-False}
- PREFECT_AUTH_USER=${PREFECT_AUTH_USER}
- PREFECT_AUTH_PASSWORD=${PREFECT_AUTH_PASSWORD}
command:
- sh
- -c
- |
case "$$USE_AUTH" in
[Tt]rue|1|[Yy]es) export PREFECT_SERVER_API_AUTH_STRING="$$PREFECT_AUTH_USER:$$PREFECT_AUTH_PASSWORD"; export PREFECT_API_AUTH_STRING="$$PREFECT_AUTH_USER:$$PREFECT_AUTH_PASSWORD"; echo "Prefect basic auth enabled" ;;
esac
exec prefect server services start

prefect-worker:
image: prefecthq/prefect:3.7.5-python3.12
Expand All @@ -57,7 +77,17 @@ services:
condition: service_healthy
environment:
- PREFECT_API_URL=http://prefect:4200/api
command: prefect worker start --pool local-pool
- USE_AUTH=${USE_AUTH:-False}
- PREFECT_AUTH_USER=${PREFECT_AUTH_USER}
- PREFECT_AUTH_PASSWORD=${PREFECT_AUTH_PASSWORD}
command:
- sh
- -c
- |
case "$$USE_AUTH" in
[Tt]rue|1|[Yy]es) export PREFECT_API_AUTH_STRING="$$PREFECT_AUTH_USER:$$PREFECT_AUTH_PASSWORD"; echo "Prefect basic auth enabled" ;;
esac
exec prefect worker start --pool local-pool

prefect-postgres:
image: postgres:14-alpine
Expand Down
6 changes: 6 additions & 0 deletions blueprints/prefect/template.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
[variables]
main_domain = "${domain}"
postgres_password = "${password:32}"
auth_password = "${password:32}"

[config]
env = [
"PREFECT_DOMAIN=${main_domain}",
"POSTGRES_PASSWORD=${postgres_password}",
# Set to True to protect the UI and API with basic auth (login: PREFECT_AUTH_USER / PREFECT_AUTH_PASSWORD).
# Clients must then set PREFECT_API_AUTH_STRING="<user>:<password>".
"USE_AUTH=False",
"PREFECT_AUTH_USER=admin",
"PREFECT_AUTH_PASSWORD=${auth_password}",
]
mounts = []

Expand Down
Loading