github.com/gobuffalo/buffalo-cli/v2@v2.0.0-alpha.15.0.20200919213536-a7350c8e6799/cli/internal/plugins/docker/templates/Dockerfile.standard.tmpl (about)

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