# Windmill Cloudron Package
#
# Windmill is an open-source workflow automation platform (scripts, flows,
# apps, schedules) that turns scripts into sharable HTTP endpoints and
# background jobs. The server embeds a default worker for single-container use.
#
# Upstream image: ghcr.io/windmill-labs/windmill:1.514.1
#   - WorkingDir /usr/src/app, binary `windmill` on PATH, listens on 8000
#   - Requires PostgreSQL (job queue uses Postgres LISTEN/NOTIFY; NO Redis)
#   - Auto-runs SQL migrations on startup
#
# Authentication: Windmill supports OIDC and SAML natively. OIDC is configured
# in the Admin Settings UI (persisted in the database), not via env vars. See
# README.md for the post-install OIDC setup steps.
FROM ghcr.io/windmill-labs/windmill:1.514.1

ENV MODE=server

# start.sh builds DATABASE_URL from the Cloudron PostgreSQL addon, waits for
# the DB, then execs the windmill server. Made executable on the host.
COPY start.sh /app/start.sh

EXPOSE 8000

CMD ["/bin/bash", "/app/start.sh"]
