Skip to content

Instantly share code, notes, and snippets.

@xerardoo
Created February 4, 2022 08:46
Show Gist options
  • Save xerardoo/0df728e1f3b71e187a4dac5a816a79ad to your computer and use it in GitHub Desktop.
Save xerardoo/0df728e1f3b71e187a4dac5a816a79ad to your computer and use it in GitHub Desktop.
Dockerfile for Golang API Project
# Credits: https://nizu.tech/go-blog-1
FROM golang:alpine
RUN mkdir /app
WORKDIR /app
ADD go.mod .
ADD go.sum .
RUN go mod download
ADD . .
RUN go get github.com/githubnemo/CompileDaemon
EXPOSE 8000
ENTRYPOINT CompileDaemon --build="go build main.go" --command=./main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment