Created
October 8, 2019 03:45
-
-
Save mattgen88/7788fb592f3cc02d45e718707ff75db1 to your computer and use it in GitHub Desktop.
Dockerfile that automatically recompiles go application and then runs it on success
This file contains hidden or 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 update && apk upgrade && \ | |
apk add --no-cache bash git openssh | |
RUN mkdir /build | |
WORKDIR /build/ | |
COPY . /build/ | |
RUN go get | |
RUN go get github.com/githubnemo/CompileDaemon | |
CMD ["CompileDaemon", "-build=go build -o app", "-directory=/build", "-command=/build/app"] | |
EXPOSE 8000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment