Current deployment flow

vs

Docker deployment flow

Something is pushed to alpha/staging/master

Gitlab Runner gets new changes

Gitlab Runner Uses DPL https://github.com/travis-ci/dpl - tool which copies the project to the Heroku

Heroku creates environment from scratch (install gems, npm), compiles assets and then deploys it

Current deployment flow

This command deploys current folder to Heroku. 

Current deployment flow

What is Gitlab Runner?

Gitlab Runner is just an app running on a simple Digital Ocean droplet. You can have several runners on a single Droplet. I have installed Docker, NPM and Heroku CLI on a droplet (which Puru created for me).

https://docs.gitlab.com/runner/install/linux-manually.html 

Something is pushed to alpha/staging/master

Gitlab Runner gets new changes

Gitlab Runner creates a Docker Image with all the dependencies and compiled assets

Gitlab Runner pushes the container to Heroku and deploys it there

Docker deployment flow

Docker deployment flow

At this point we have all new files in current folder

this script checks if JS wasn't changed and copies old assets to public/assets/packs

this is needed to deploy images to heroku

I need to know the DATABASE_URL to run PgBouncer after container is built

this saves the compiled assets in order to use it in step 1 of the next deployments

this command releases the container

this command restarts the app

Docker deployment flow

By Sergey Tyan

Docker deployment flow

  • 7