Update dependencies when using Docker for Gobuffalo
If you have been playing with buffalo I'm pretty sure you've stumbled upon one of their tutorials about Deploying Buffalo to Heroku with Docker.
Following the tutorial / blog-post makes a lot of sense, it'll get you going with Heroku and Buffalo. I did hit some snag adding go dependencies and libraries, specially when building the docker-image. The base generated Dockerfile is missing a line to add the new dependencies.
FROM gobuffalo/buffalo:v0.9.1.2
RUN mkdir -p $GOPATH/src/gitlab.com/<GITHUB_USERNAME>/coke
WORKDIR $GOPATH/src/gitlab.com/<GITHUB_USERNAME>/coke
# this will cache the npm install step, unless package.json changes
ADD package.json .
RUN npm install
ADD . .
RUN buffalo build --static -o /bin/app
EXPOSE 3000
# Comment out to run the migrations before running the binary:
# CMD /bin/app migrate; /bin/app
CMD /bin/app
You should add: RUN go get ./...
...
ADD . .
RUN go get ./...
RUN buffalo build --static -o /bin/app
...
Written by Julius Francisco
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Go
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#