Files
xinfra/server/Dockerfile.backend
T

28 lines
485 B
Docker
Raw Normal View History

2026-07-13 14:39:56 +08:00
FROM golang:1.26-alpine AS builder
WORKDIR /app
ENV GOPROXY=https://goproxy.cn,direct \
GOSUMDB=sum.golang.google.cn
COPY go.mod go.sum ./
RUN go mod download
COPY cmd ./cmd
2026-07-15 15:12:54 +08:00
COPY docs ./docs
2026-07-13 14:39:56 +08:00
COPY internal ./internal
RUN CGO_ENABLED=0 GOOS=linux go build -o /out/authserver ./cmd/server
FROM alpine:3.22
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /authserver/backend
COPY --from=builder /out/authserver /usr/local/bin/authserver
EXPOSE 8083
CMD ["authserver"]