hishtory/backend/server/native-arch-Dockerfile
2022-11-05 13:30:37 -07:00

12 lines
361 B
Plaintext

FROM golang:1.18 AS builder
COPY go.mod ./
COPY go.sum ./
RUN unset GOPATH; go mod download
COPY . ./
RUN unset GOPATH; go build -o /server -ldflags "-X main.ReleaseVersion=v0.`cat VERSION`" backend/server/server.go
FROM golang:1.18
COPY --from=builder /server /server
# TODO: use wait-for-it.sh instead of a janky sleep
CMD ["sh", "-c", "sleep 5; /server"]