diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 0000000..8d3ab52 --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,34 @@ +# ── Build stage ────────────────────────────────────────────────────────────── +FROM golang:1.22-alpine AS builder + +WORKDIR /app + +# Copy go mod files first for layer caching +COPY go.mod go.sum ./ +RUN go mod download + +# Copy source and build +COPY . . +RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o msdl-backend main.go + +# ── Runtime stage ───────────────────────────────────────────────────────────── +FROM alpine:3.19 + +# Security: run as non-root +RUN addgroup -S app && adduser -S app -G app + +WORKDIR /app + +# Copy binary and optional static public folder +COPY --from=builder /app/msdl-backend . +COPY --from=builder /app/public ./public + +RUN chown -R app:app /app +USER app + +EXPOSE 3002 + +HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \ + CMD wget -qO- http://localhost:3002/health || exit 1 + +CMD ["./msdl-backend"] diff --git a/frontend/src/components/SiteFooter.tsx b/frontend/src/components/SiteFooter.tsx index 49c57aa..a231272 100644 --- a/frontend/src/components/SiteFooter.tsx +++ b/frontend/src/components/SiteFooter.tsx @@ -16,7 +16,7 @@ export default function SiteFooter() { About ·