Fix container duplication

This commit is contained in:
2020-11-08 01:32:45 +01:00
parent f44caa8ad8
commit 0bf7e54ad7
6 changed files with 69 additions and 28 deletions

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
FROM golang:alpine as builder
# Application Directory
RUN mkdir /app
WORKDIR /app
# First handle dependencies as those probably are more stable than rest of codebase
COPY ./go.mod /app/
COPY ./go.sum /app/
RUN go mod download
# Copy source and build app
COPY . /app
RUN go build .
FROM alpine
# Copy over the app from the builder image
COPY --from=builder /app/lookbuilding /lookbuilding
ENTRYPOINT ["/lookbuilding"]