Files
evanpage/backend/Dockerfile
evan ffecc9451d backend: add bookmark CRUD with public list endpoint
New bookmarks feature: domain model, repository, service and handler
supporting list/create/update/delete. Public endpoint exposes the
admin user's bookmarks for the homepage navigation grid; authenticated
endpoints scope by user. Dev Dockerfile drops air for plain `go run`
and uses goproxy.cn to avoid build failures on the deploy host.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-03 01:51:43 +08:00

29 lines
474 B
Docker

FROM golang:1.25-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o server ./cmd/api/main.go
FROM golang:1.25-alpine AS dev
ENV GOPROXY=https://goproxy.cn,direct
ENV GOSUMDB=off
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
EXPOSE 8080
CMD ["go", "run", "./cmd/api/main.go"]
FROM alpine:latest AS production
WORKDIR /app
COPY --from=builder /app/server .
EXPOSE 8080
CMD ["./server"]