Move ClaimsFromContext and MustUserID helpers from httpserver to new requestctx package for better separation of concerns. Update all imports across auth, device, policy, and user handlers. Fix Dockerfile to copy go.sum and run go mod tidy before download.
17 lines
387 B
Docker
17 lines
387 B
Docker
FROM golang:1.23-alpine AS builder
|
|
WORKDIR /src
|
|
COPY go.mod ./
|
|
COPY go.sum* ./
|
|
COPY . .
|
|
RUN go mod tidy
|
|
RUN go mod download
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -o /out/nexavpn-api ./cmd/api
|
|
|
|
FROM alpine:3.21
|
|
WORKDIR /app
|
|
COPY --from=builder /out/nexavpn-api /usr/local/bin/nexavpn-api
|
|
COPY migrations ./migrations
|
|
COPY seed ./seed
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["/usr/local/bin/nexavpn-api"]
|