From 9d25f5efe3351c48bc01ddb9fddc05144d11fa69 Mon Sep 17 00:00:00 2001 From: Ryan Malloy Date: Mon, 23 Feb 2026 05:44:58 -0700 Subject: [PATCH] Fix docs root showing Caddy default page, fix MCP healthcheck - Clear /usr/share/caddy/* before copying build output to remove the default "Caddy works!" index.html from the base image - Add root redirect: / -> /getting-started/ (permanent) - Fix try_files to use {path}/index.html for Starlight directories - Switch MCP healthcheck to TCP socket (GET /mcp returns 406 without proper Accept headers) --- Dockerfile.mcp | 2 +- docs/Caddyfile.prod | 4 +++- docs/Dockerfile | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile.mcp b/Dockerfile.mcp index 6d7b239..ff2edaa 100644 --- a/Dockerfile.mcp +++ b/Dockerfile.mcp @@ -21,7 +21,7 @@ COPY src/ src/ EXPOSE 8000 HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ - CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/mcp')" || exit 1 + CMD python -c "import socket; s=socket.create_connection(('127.0.0.1',8000),timeout=3); s.close()" || exit 1 USER nobody CMD ["mcnoaa-tides"] diff --git a/docs/Caddyfile.prod b/docs/Caddyfile.prod index 0bb65e7..918fad7 100644 --- a/docs/Caddyfile.prod +++ b/docs/Caddyfile.prod @@ -1,9 +1,11 @@ :4321 { encode gzip + redir / /getting-started/ permanent + handle { root * /usr/share/caddy - try_files {path} {path}/ /index.html + try_files {path} {path}/index.html file_server } } diff --git a/docs/Dockerfile b/docs/Dockerfile index 61b60f6..51ad797 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -21,6 +21,7 @@ RUN --mount=type=cache,target=/app/.astro \ # --- Prod --- FROM caddy:2-alpine AS prod +RUN rm -rf /usr/share/caddy/* COPY --from=build /app/dist /usr/share/caddy COPY Caddyfile.prod /etc/caddy/Caddyfile EXPOSE 4321