first commit

This commit is contained in:
ston1th 2019-12-04 14:26:39 +01:00
commit be3c522f14
11 changed files with 635 additions and 0 deletions

12
Dockerfile Normal file
View file

@ -0,0 +1,12 @@
FROM golang:alpine as builder
RUN adduser -D -g '' appuser
RUN mkdir /build
ADD . /build/
WORKDIR /build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -gcflags 'all=-e' -ldflags "-s -w" -o main .
FROM scratch
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /build/main /main
USER appuser
EXPOSE 8080
ENTRYPOINT ["/main"]