Multi-stage build: Node 22 for Astro build, Caddy 2 Alpine for static file serving. Reverse-proxied via caddy-docker-proxy.
22 lines
440 B
Docker
22 lines
440 B
Docker
# Stage 1: Build the Astro/Starlight site
|
|
FROM node:22-alpine AS build
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json package-lock.json* ./
|
|
RUN npm ci
|
|
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# Stage 2: Serve static files with Caddy
|
|
FROM caddy:2-alpine
|
|
|
|
COPY --from=build /app/dist /srv
|
|
COPY Caddyfile /etc/caddy/Caddyfile
|
|
|
|
EXPOSE 8080
|
|
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD wget -qO- http://127.0.0.1:8080/health || exit 1
|