-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
28 lines (22 loc) · 840 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# ------------------------------------------------------
# Dockerfile
# ------------------------------------------------------
# image: shortesturl
# tag: <COMMIT HASH>
# name: darioblanco/shortesturl
# requires: golang:1.16
# authors: [email protected]
# ------------------------------------------------------
# BUILDER - Artifacts build for production
FROM golang:1.17 as builder
WORKDIR /go/src/github.com/darioblanco/shortesturl/
COPY . .
ENV CGO_ENABLED=0
ENV GOOS=linux
RUN make -r build PRODUCTION=1
# RUNNER - Production image
FROM gcr.io/distroless/static-debian11
WORKDIR /bin/
COPY --from=builder /go/src/github.com/darioblanco/shortesturl/tmp/shortesturl .
COPY --from=builder /go/src/github.com/darioblanco/shortesturl/cmd/config.default.yaml ./cmd/
ENTRYPOINT [ "/bin/shortesturl" ]