diff --git a/generators/docker/multi/templates/Dockerfile.tmpl b/generators/docker/multi/templates/Dockerfile.tmpl index 0059cf323..9627eba67 100644 --- a/generators/docker/multi/templates/Dockerfile.tmpl +++ b/generators/docker/multi/templates/Dockerfile.tmpl @@ -28,13 +28,16 @@ FROM alpine RUN apk add --no-cache bash RUN apk add --no-cache ca-certificates -# Comment out to run the binary in "production" mode: -# ENV GO_ENV=production - WORKDIR /bin/ COPY --from=builder /bin/app . +# Comment out to run the binary in "production" mode: +# ENV GO_ENV=production + +# Bind the app to 0.0.0.0 so it can be seen from outside the container +ENV ADDR=0.0.0.0 + EXPOSE 3000 # Comment out to run the migrations before running the binary: diff --git a/generators/docker/standard/templates/Dockerfile.tmpl b/generators/docker/standard/templates/Dockerfile.tmpl index 6c4c60737..4b37920ba 100644 --- a/generators/docker/standard/templates/Dockerfile.tmpl +++ b/generators/docker/standard/templates/Dockerfile.tmpl @@ -24,6 +24,12 @@ RUN go get $(go list ./... | grep -v /vendor/) {{end -}} RUN buffalo build --static -o /bin/app +# Comment out to run the binary in "production" mode: +# ENV GO_ENV=production + +# Bind the app to 0.0.0.0 so it can be seen from outside the container +ENV ADDR=0.0.0.0 + EXPOSE 3000 # Comment out to run the migrations before running the binary: