• Run services via Docker Compose e.g. Postgresql, Redis, Elastic Search ◦ Faster and reliable setup of projects ◦ Manageable colocation of projects with different services version on the same host machine ◦ Service-based architecture • Run the application in the host machine ◦ Easier debugging ◦ Less tooling
No reliance on the CI/CD service provider for the availability of specific version of services ◦ No reliance on the CI/CD service provider caching but instead use Docker image caching • Production ◦ Less reliance on Heroku-only deployment ◦ Possibility to migrate the application to more complex deployment setup e.g. k8s ⇒ Service providers are adopting Docker container as their preferred platform of choice over their often proprietary system. Let’s be ahead of the curve!
host machine ◦ Run the services in Docker containers via Docker Compose • Test ◦ Run both the application and services in Docker containers via Docker Compose ◦ Run the tests inside the application container • Production ◦ Run the application processes (app, worker) in Docker containers ◦ Use Heroku add-ons for services such as databases
in registries (~ repositories) Docker Hub Google Container Registry Heroku Registry Local Machine CI/CD Heroku AWS Digital Ocean AMZ EC2 Container Registry quay.io Google Cloud
only the application can be deployed as a Docker container. For services use Heroku add-ons. • Multi-process application needs multiple Dockerfiles with distinct CMD
within 60 seconds • Docker Containers can be killed and restarted So the Dockerfile needs to contain all build steps required for the application to start without any delay: • Setup all dependencies (ruby/JS) • Precompile all assets • Execute any scripts necessary e.g. rake tasks