github.com/segakazzz/buffalo@v0.16.22-0.20210119082501-1f52048d3feb/genny/docker/templates/standard/Dockerfile.tmpl (about) 1 FROM gobuffalo/buffalo:{{.opts.Version}} 2 3 ENV GO111MODULE on 4 ENV GOPROXY http://proxy.golang.org 5 6 RUN mkdir -p /src/{{.opts.App.PackagePkg}} 7 WORKDIR /src/{{.opts.App.PackagePkg}} 8 9 {{if .opts.App.AsWeb -}} 10 {{if .opts.App.WithWebpack -}} 11 # this will cache the npm install step, unless package.json changes 12 ADD package.json . 13 {{if .opts.App.WithYarn -}} 14 ADD yarn.lock . 15 RUN yarn install --no-progress 16 {{else -}} 17 RUN npm install --no-progress 18 {{end -}} 19 {{end -}} 20 {{end -}} 21 22 # Copy the Go Modules manifests 23 COPY go.mod go.mod 24 COPY go.sum go.sum 25 # cache deps before building and copying source so that we don't need to re-download as much 26 # and so that source changes don't invalidate our downloaded layer 27 RUN go mod download 28 29 ADD . . 30 RUN buffalo build --static -o /bin/app 31 32 # Uncomment to run the binary in "production" mode: 33 # ENV GO_ENV=production 34 35 # Bind the app to 0.0.0.0 so it can be seen from outside the container 36 ENV ADDR=0.0.0.0 37 38 EXPOSE 3000 39 40 # Uncomment to run the migrations before running the binary: 41 # CMD /bin/app migrate; /bin/app 42 CMD exec /bin/app