From 2a32dd4bfd09eda36ef3de473ba41e32e21b212f Mon Sep 17 00:00:00 2001 From: Silberengel Date: Thu, 23 Apr 2026 12:10:58 +0200 Subject: [PATCH] bug-fix build --- Dockerfile | 5 ++++- compose.yaml | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c9d2505..05efd10 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,7 @@ VOLUME /app/var/ # hadolint ignore=DL3008 RUN apt-get update && apt-get install -y --no-install-recommends \ acl \ + curl \ file \ gettext \ git \ @@ -55,7 +56,9 @@ COPY --link frankenphp/Caddyfile /etc/caddy/Caddyfile ENTRYPOINT ["docker-entrypoint"] -HEALTHCHECK --start-period=60s CMD curl -f http://localhost:2019/metrics || exit 1 +# Hit the public HTTP server, not Caddy :2019 admin (not always available the same way in all setups). +HEALTHCHECK --interval=10s --timeout=5s --retries=6 --start-period=120s \ + CMD curl -fsS http://127.0.0.1/ -o /dev/null || exit 1 CMD [ "frankenphp", "run", "--config", "/etc/caddy/Caddyfile" ] # Dev FrankenPHP image diff --git a/compose.yaml b/compose.yaml index 4c72530..4f16977 100644 --- a/compose.yaml +++ b/compose.yaml @@ -4,6 +4,14 @@ services: build: context: . dockerfile: Dockerfile + # Overrides Dockerfile HEALTHCHECK: verify Caddy/FrankenPHP serves the app (not Caddy :2019 admin, + # which is unreliable for “ready”). `docker compose up --wait` requires this to pass. + healthcheck: + test: ["CMD", "curl", "-fsS", "http://127.0.0.1/", "-o", "/dev/null"] + interval: 10s + timeout: 5s + retries: 6 + start_period: 120s environment: APP_ENV: ${APP_ENV:-dev} # Caddy site address: :80 accepts any Host (needed when the app is reached via localhost:HTTP_PORT).