937da1962b
The project uses only Go stdlib with zero external dependencies, so go.sum does not exist. The Dockerfile COPY instruction fails when go.sum is missing. Closes leeworks-agents/gitea-mobile#89 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
17 lines
421 B
Docker
17 lines
421 B
Docker
# Stage 1: Build
|
|
FROM golang:1.22-alpine AS builder
|
|
WORKDIR /app
|
|
COPY go.mod ./
|
|
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"]
|