Last active
June 15, 2018 11:34
-
-
Save aslrousta/df05a953bf2afc81c275d60cf00b7be9 to your computer and use it in GitHub Desktop.
Sample Dockerfile for Go projects.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:alpine AS builder | |
RUN apk --no-cache --update add git | |
RUN go get ... \ | |
&& go get ... \ | |
&& go get github.com/ddollar/forego | |
COPY . src/gitlab.com/example.com/auth | |
RUN cd src/gitlab.com/example.com/auth \ | |
&& go build \ | |
&& go install | |
FROM alpine:latest AS base | |
RUN apk --no-cache --update add bash | |
COPY --from=builder /go/bin/forego /usr/local/bin/ | |
COPY --from=builder /go/bin/auth /usr/local/bin/ | |
RUN echo "web: /usr/local/bin/auth" >/root/Procfile | |
EXPOSE 5000/tcp | |
WORKDIR /root | |
ENTRYPOINT [ "forego", "start", "-r" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment