Add Dockerfile for containerized deployment
Two-stage Alpine build, plain HTTP on :8080 behind mc-proxy L7. Follows mcdoc pattern — no USER/VOLUME directives (rootless podman). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
24
Dockerfile
Normal file
24
Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
||||
FROM golang:1.25-alpine AS builder
|
||||
|
||||
ARG VERSION=dev
|
||||
|
||||
RUN apk add --no-cache git
|
||||
|
||||
WORKDIR /build
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w -X main.version=${VERSION}" -o mcq ./cmd/mcq
|
||||
|
||||
FROM alpine:3.21
|
||||
|
||||
RUN apk add --no-cache ca-certificates tzdata
|
||||
|
||||
COPY --from=builder /build/mcq /usr/local/bin/mcq
|
||||
|
||||
WORKDIR /srv/mcq
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT ["mcq"]
|
||||
CMD ["server", "--config", "/srv/mcq/mcq.toml"]
|
||||
Reference in New Issue
Block a user