Skip to content

Commit

Permalink
Add Dockerfile for server
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Hughes committed Feb 25, 2020
1 parent 5c339b1 commit 09653bc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions build/docker/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ARG GOLANG_TAG=1.13-alpine

FROM golang:$GOLANG_TAG as build-stage
RUN apk add --no-cache git ca-certificates && update-ca-certificates
WORKDIR /src
COPY . .
RUN CGO_ENABLED=0 go install -ldflags "-s -w -X main.version=`git describe --long --dirty --always`" ./cmd/server/...

FROM scratch
COPY --from=build-stage /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build-stage /go/bin/server /usr/local/bin/
USER 1000
EXPOSE 8080/tcp
ENTRYPOINT ["server"]

0 comments on commit 09653bc

Please sign in to comment.