2023-10-02 03:00:58 +02:00
|
|
|
FROM golang:1.21-alpine3.17 AS builder
|
2023-09-05 20:52:46 +02:00
|
|
|
|
|
|
|
WORKDIR /app
|
2023-09-16 02:10:55 +02:00
|
|
|
RUN apk add --update --no-cache --virtual .build-deps build-base
|
2023-09-05 20:52:46 +02:00
|
|
|
COPY go.mod go.sum ./
|
|
|
|
RUN go mod download
|
2022-04-09 08:56:02 +02:00
|
|
|
COPY . ./
|
2023-09-05 20:52:46 +02:00
|
|
|
ARG GOARCH
|
2023-09-16 02:10:55 +02:00
|
|
|
RUN GOARCH=${GOARCH} go build -o /server -ldflags "-X main.ReleaseVersion=v0.`cat VERSION`" backend/server/server.go && \
|
2023-09-05 20:52:46 +02:00
|
|
|
apk del .build-deps
|
2022-04-09 08:56:02 +02:00
|
|
|
|
2023-09-05 20:52:46 +02:00
|
|
|
FROM alpine:3.17
|
2022-04-17 01:28:53 +02:00
|
|
|
COPY --from=builder /server /server
|
|
|
|
CMD ["/server"]
|