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`.
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
.git
|
||||||
|
reference/
|
||||||
|
test/
|
||||||
|
share
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
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"]
|
||||||
Reference in New Issue
Block a user