Skip to content

Commit 77875ae

Browse files
committed
Add Dockerfile for todo backend
Signed-off-by: solidnerd <niclas@mietz.io>
1 parent e4f8c25 commit 77875ae

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Dockerfile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
FROM envoyproxy/envoy:latest
2-
RUN apt-get update
3-
COPY envoy.yaml /etc/envoy.yaml
4-
CMD /usr/local/bin/envoy -c /etc/envoy.yaml
1+
FROM golang:1.11.4-stretch as builder
2+
WORKDIR $GOPATH/src/todo
3+
ENV GO111MODULE=on
4+
COPY go.mod .
5+
COPY go.sum .
6+
RUN go mod download
7+
COPY . .
8+
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix nocgo -o /app .
9+
10+
FROM scratch
11+
COPY --from=builder /app ./
12+
ENTRYPOINT ["./app"]

0 commit comments

Comments
 (0)