2021-11-02 16:44:51 +02:00
|
|
|
# FROM golang:1.17-alpine AS database
|
2021-11-06 21:06:42 +02:00
|
|
|
# AWS CodeBuild fails due to Docker's pull rate limit, using ECR.
|
2021-11-02 16:44:51 +02:00
|
|
|
FROM public.ecr.aws/bitnami/golang:1.17 AS database
|
2021-06-01 13:26:02 +02:00
|
|
|
WORKDIR /go/src/app
|
2021-11-02 16:55:29 +02:00
|
|
|
COPY go.* ./
|
2021-06-08 20:26:14 +02:00
|
|
|
COPY internal ./internal
|
2021-06-01 13:26:02 +02:00
|
|
|
RUN go mod download
|
2021-11-02 16:55:29 +02:00
|
|
|
COPY cmd/database ./
|
2021-06-01 13:26:02 +02:00
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags '-s' -o database .
|
|
|
|
|
|
|
|
FROM scratch
|
|
|
|
COPY --from=database /go/src/app/database /database
|
|
|
|
CMD ["/database"]
|