Use better dockerfile
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Hamcha 2019-08-22 14:48:33 +02:00
parent ea93262dcc
commit 37435c9706
Signed by: hamcha
GPG key ID: 44AD3571EB09A39E
2 changed files with 18 additions and 5 deletions

1
.dockerignore Normal file
View file

@ -0,0 +1 @@
README.md

View file

@ -1,8 +1,20 @@
FROM golang:alpine FROM golang:alpine AS builder
RUN apk add git
ENV GOPROXY https://modules.fromouter.space ENV GOPROXY https://modules.fromouter.space
RUN go get git.fromouter.space/mcg/mlpdraftbot ENV GO111MODULE=on
ENTRYPOINT [ "mlpdraftbot" ] WORKDIR /app
EXPOSE 5749
# Get updated modules
COPY ./ ./
RUN go mod download
# Compile code
RUN CGO_ENABLED=0 go build -o /svc .
FROM scratch AS final
# Import the compiled executable from the first stage.
COPY --from=builder /svc /svc
CMD [ "/svc" ]