674c75f5eb
Add empty go.sum file (no external dependencies yet) and update the Dockerfile build stage to COPY go.sum alongside go.mod for reproducible module downloads. This ensures the Docker build does not fail when Go requires go.sum to be present. Closes leeworks-agents/gitea-mobile#203 Closes leeworks-agents/gitea-mobile#180 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
17 lines
428 B
Docker
17 lines
428 B
Docker
# Stage 1: Build
|
|
FROM golang:1.22-alpine AS builder
|
|
WORKDIR /app
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /gitea-mobile ./cmd/server
|
|
|
|
# Stage 2: Runtime
|
|
FROM gcr.io/distroless/static:nonroot
|
|
COPY --from=builder /gitea-mobile /gitea-mobile
|
|
COPY static/ /static/
|
|
COPY internal/templates/ /templates/
|
|
EXPOSE 8080
|
|
USER nonroot:nonroot
|
|
ENTRYPOINT ["/gitea-mobile"]
|