2022-12-02 21:03:08 +01:00
|
|
|
# Builder
|
|
|
|
FROM golang:alpine
|
|
|
|
|
|
|
|
ARG BIN_OUTPUT=/go/bin
|
|
|
|
ARG GO_SERVER=cmd/server/main.go
|
2022-12-17 06:31:35 +01:00
|
|
|
ARG GO_MIGRATE=cmd/migrate/main.go
|
2023-10-01 21:35:21 +02:00
|
|
|
ARG GO_HEALTH=cmd/health/main.go
|
2022-12-02 21:03:08 +01:00
|
|
|
|
|
|
|
WORKDIR /go/src/app
|
|
|
|
COPY src ./
|
|
|
|
|
|
|
|
RUN export CGO_ENABLED=0 ; export GOOS=linux ; export GOARCH=amd64 && \
|
2022-12-17 06:31:35 +01:00
|
|
|
go build -ldflags="-w -s" -o "$BIN_OUTPUT/server" $GO_SERVER && \
|
2023-10-01 21:35:21 +02:00
|
|
|
go build -ldflags="-w -s" -o "$BIN_OUTPUT/migrate" $GO_MIGRATE && \
|
|
|
|
go build -ldflags="-w -s" -o "$BIN_OUTPUT/health" $GO_HEALTH
|
2022-12-02 21:03:08 +01:00
|
|
|
|