-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
32 lines (22 loc) · 833 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# syntax=docker/dockerfile:1
FROM golang:1.22-alpine as BUILDER
RUN mkdir /app
WORKDIR /app
ARG BUILD_VERSION
ARG GITHUB_SHA
COPY ["go.mod", "go.sum", "./"]
COPY ["src/", "./src/"]
COPY ["tes3mp/scripts/custom/IrcBridge/IrcBridge.lua", "/app/tes3mp/scripts/custom/IrcBridge/IrcBridge.lua"]
RUN apk add --no-cache protoc
RUN cd src && \
go install google.golang.org/protobuf/cmd/protoc-gen-go && \
go get google.golang.org/grpc/cmd/protoc-gen-go-grpc && \
go generate && \
go mod download && \
go build -ldflags="-X 'main.Build=$BUILD_VERSION' -X 'main.GitCommit=$GITHUB_SHA'" -o /app/build/goTES3MP-Linux .
FROM golang:1.20-alpine as RUNNER
RUN mkdir /app
WORKDIR /app
COPY --from=BUILDER /app/build/goTES3MP-Linux /app/goTES3MP-Linux
RUN chmod +x /app/goTES3MP-Linux
ENTRYPOINT ["/app/goTES3MP-Linux"]