Files
blog-ahmza-com/Dockerfile
T
ahmza 898e3003a2 Switch static server from nginx to static-web-server
Replace nginx:alpine-slim with the scratch-based static-web-server
image, reducing the final image size ~32MB -> ~23MB (28% smaller).

- Dockerfile: serve from static-web-server:2, copy site to /public
- sws.toml: mirror previous nginx behavior (compression, cache-control,
  SPA index fallback) plus security headers and /health endpoint
- Remove now-unused nginx.conf
2026-07-25 01:04:17 +01:00

12 lines
307 B
Docker
Executable File

FROM ghcr.io/hugomods/hugo:0.157.0 AS build
WORKDIR /tmp/hugo
COPY . .
RUN hugo --gc --minify
FROM ghcr.io/static-web-server/static-web-server:2
COPY sws.toml /etc/sws.toml
COPY --from=build /tmp/hugo/public /public
ENV SERVER_CONFIG_FILE=/etc/sws.toml
EXPOSE 80/tcp
CMD ["--config-file", "/etc/sws.toml"]