Files
share/Dockerfile
T
TZGyn c8f670e920 Add Dockerfile to deploy the relay server
Multi-stage build: compiles with CGO disabled in golang:1.25-alpine,
runs the static binary in a plain alpine:3.20 image. Defaults to
"share relay" on port 9009; override with extra args at `docker run`.
2026-07-20 12:29:46 +08:00

13 lines
255 B
Docker

FROM golang:1.25-alpine AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o /out/share .
FROM alpine:3.20
COPY --from=build /out/share /usr/local/bin/share
EXPOSE 9009
ENTRYPOINT ["share"]
CMD ["relay"]