2022-11-30 02:08:59 +01:00
|
|
|
# Builder
|
|
|
|
FROM golang:alpine
|
|
|
|
|
|
|
|
ARG BIN_OUTPUT=/go/bin
|
|
|
|
ARG GO_SERVER=cmd/server/main.go
|
2022-12-17 08:26:32 +01:00
|
|
|
ARG GO_MIGRATE=cmd/migrate/main.go
|
2022-11-30 02:08:59 +01:00
|
|
|
ARG GO_WORKER=cmd/worker/main.go
|
2024-07-19 21:27:13 +02:00
|
|
|
ARG GO_HEALTH=cmd/health/main.go
|
2022-11-30 02:08:59 +01:00
|
|
|
|
|
|
|
WORKDIR /go/src/app
|
|
|
|
COPY src ./
|
|
|
|
|
2022-12-01 06:22:54 +01:00
|
|
|
RUN export CGO_ENABLED=0 ; export GOOS=linux ; export GOARCH=amd64 && \
|
2022-11-30 02:08:59 +01:00
|
|
|
go build -ldflags="-w -s" -o "$BIN_OUTPUT/server" $GO_SERVER && \
|
2022-12-17 08:26:32 +01:00
|
|
|
go build -ldflags="-w -s" -o "$BIN_OUTPUT/migrate" $GO_MIGRATE && \
|
2024-07-19 21:27:13 +02:00
|
|
|
go build -ldflags="-w -s" -o "$BIN_OUTPUT/worker" $GO_WORKER && \
|
|
|
|
go build -ldflags="-w -s" -o "$BIN_OUTPUT/health" $GO_HEALTH
|