Closed marnen closed 6 years ago
This will also make Travis builds not have to install so much stuff, I think.
Google Cloud Engine docs for Docker: https://cloud.google.com/compute/docs/containers/deploying-containers. I have no particular love (or hate) for Google Cloud; I just think that their free tier (with Docker) is most suitable for our needs.
I think I will try Alpine Linux as container OS first, and fall back to Ubuntu if that doesn't work.
Possibly helpful: https://blog.codeship.com/build-minimal-docker-container-ruby-apps/
Actually, for now, in the interests of quick development and decent base image, I think I'll use https://github.com/phusion/passenger-docker for deployment. We can always change this later.
...or not. Puma is multithreaded and may be a better choice than Passenger now. Looking at https://erudinsky.com/2017/05/15/how-to-run-rails-app-with-postgres-puma-and-nginx-in-docker for more ideas.
That tutorial looks pretty good, actually. I'll probably largely follow it.
I'm going to reduce the scope of this story. For right now, we'll just produce a Docker container for development and Travis, and I'll move the production Docker container to a separate story (multistage builds may be helpful).
We now have master being automatically built on Docker Hub.
Rats. I can't get Travis to use cache_from
correctly in the compose file. See https://github.com/docker/docker-py/issues/998 and https://github.com/docker/docker-py/pull/1582 for possible reasons.
I think I may have been wrong about cache_from
. It looks like I had set the environment variables improperly so that the compose file I wanted wasn't being picked up.
In order to deploy to Google Cloud (if we go that route) and generally make setup easier, we should containerize the application.