Marco Zeisler 3ab10859d7 move template to ./template;
added global README.md;
2020-11-17 19:43:35 +01:00

24 lines
548 B
Docker

#########################
###### 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