github.com/jacobsoderblom/buffalo@v0.11.0/generators/docker/standard/templates/Dockerfile.tmpl (about)

     1  FROM gobuffalo/buffalo:{{.opts.Version}}
     2  
     3  RUN mkdir -p $GOPATH/src/{{.opts.App.PackagePkg}}
     4  WORKDIR $GOPATH/src/{{.opts.App.PackagePkg}}
     5  
     6  {{if .opts.AsWeb -}}
     7  {{if .opts.App.WithWebpack -}}
     8  # this will cache the npm install step, unless package.json changes
     9  ADD package.json .
    10  {{if .opts.App.WithYarn -}}
    11  ADD yarn.lock .
    12  RUN yarn install --no-progress
    13  {{else -}}
    14  RUN npm install --no-progress
    15  {{end -}}
    16  {{end -}}
    17  {{end -}}
    18  
    19  ADD . .
    20  {{if .opts.App.WithDep -}}
    21  RUN dep ensure
    22  {{else -}}
    23  RUN go get $(go list ./... | grep -v /vendor/)
    24  {{end -}}
    25  RUN buffalo build --static -o /bin/app
    26  
    27  # Comment out to run the binary in "production" mode:
    28  # ENV GO_ENV=production
    29  
    30  # Bind the app to 0.0.0.0 so it can be seen from outside the container
    31  ENV ADDR=0.0.0.0
    32  
    33  EXPOSE 3000
    34  
    35  # Comment out to run the migrations before running the binary:
    36  # CMD /bin/app migrate; /bin/app
    37  CMD exec /bin/app