Add template

This commit is contained in:
Dominik Schubert
2019-10-14 15:35:19 +02:00
commit 02873fc0a1
36 changed files with 12623 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
#########################
###### build stage ######
#########################
FROM golang:1.13.1-alpine AS builder
WORKDIR /app
RUN apk add --no-cache git
# Prevent downloads on every build.
# Only downloads the dependencies if they actually change
COPY go.mod go.sum ./
RUN go mod download
# Build the app
COPY . .
RUN go build -v -o api
#########################
###### final stage ######
#########################
FROM alpine:latest
RUN apk --no-cache add ca-certificates
COPY --from=builder /app/api /app/api
EXPOSE 3000
ENTRYPOINT ./app/api