diff --git a/apps/web/Caddyfile b/apps/web/Caddyfile new file mode 100644 index 0000000..a4b0689 --- /dev/null +++ b/apps/web/Caddyfile @@ -0,0 +1,10 @@ +# Caddy-Config für das statische Web-Image (cockpit-web). +# Liefert die gebaute SPA aus /srv mit SPA-Fallback auf index.html. +# /api und /trpc werden in Produktion bereits von Traefik (höhere Priorität) +# an cockpit-api geroutet und erreichen diesen Container nicht. +:80 { + root * /srv + encode zstd gzip + try_files {path} /index.html + file_server +} diff --git a/apps/web/Dockerfile b/apps/web/Dockerfile index 21cf887..9fca5e3 100644 --- a/apps/web/Dockerfile +++ b/apps/web/Dockerfile @@ -19,6 +19,8 @@ COPY packages/shared ./packages/shared RUN pnpm --filter web build -# --- runtime (static via Caddy in production compose) --- +# --- runtime (static via Caddy) --- FROM caddy:2-alpine AS runtime +# Eigene Caddy-Config statt der Default-Welcome-Seite: SPA aus /srv ausliefern. +COPY apps/web/Caddyfile /etc/caddy/Caddyfile COPY --from=builder /repo/apps/web/dist /srv