Files
XHChat/server/Dockerfile
T

15 lines
365 B
Docker

FROM golang:1.27.4-alpine AS build
WORKDIR /src
ARG GOPROXY=https://proxy.golang.org,direct
ENV GOPROXY=${GOPROXY}
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -trimpath -o /out/xhchat-api ./cmd/api
FROM alpine:3.23
COPY --from=build /out/xhchat-api /usr/local/bin/xhchat-api
USER 65532:65532
EXPOSE 8080
ENTRYPOINT ["xhchat-api"]