2023-09-05 20:52:46 +02:00
|
|
|
FROM golang:1.18-alpine3.17 AS builder
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
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
|
|
|
|
RUN apk add --update --no-cache --virtual .build-deps build-base && \
|
2023-09-12 16:09:38 +02:00
|
|
|
GOARCH=${GOARCH} go build -o /server -ldflags "-X release.Version=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"]
|