1
0
Fork 0
short/Dockerfile

19 lines
376 B
Docker

FROM golang:1.11-alpine as go
WORKDIR /go/src/github.com/serverwentdown/short
COPY . .
ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64
RUN go build -ldflags '-extldflags "-static" -X main.version=1.0' -o short
FROM scratch
EXPOSE 8080
COPY --from=go /go/src/github.com/serverwentdown/short/short /short
HEALTHCHECK CMD ["/short", "-healthcheck"]
ENTRYPOINT ["/short"]