Run Consistent Dev, Stage & Prod Docker Environments

InstructorMark Shust

Share this video with your friends

Send Tweet

Docker makes it easy to have near-full environment parity between dev, stage and prod. In this lesson we’ll go over a typical setup within Docker Compose, and how to manage backing services between dev, stage and prod.

5f8dcf43-90be-44f5-adb2-112adaaf6f9e@anonymous.zalando.com
~ 7 years ago

Hi. One question, env variables shouldn't be store in the VCS. Where should they be stored then? It is a mystery part of the 12 factors App :) Thanks

Alan Plum
~ 7 years ago

Hi. One question, env variables shouldn't be store in the VCS. Where should they be stored then? It is a mystery part of the 12 factors App :)

Yupp, that seems to be an "exercise left to the reader" but if you can't think of any place other than the VCS, you can store them in the VCS as long as you encrypt them with a strong cipher. This means they're "hidden in plain sight" and as long as the unencrypted file never touches the VCS you get the best of both worlds. Of course that only moves the problem from "how does the env file end up on the server" to "how does the decryption key end up on the server" but that seems easier to solve.

Mark Shustinstructor
~ 7 years ago

I'd recommend to not put them on VCS. Just keep them on the filesystem? :) Just don't version them.

If you need backups of env vars, just make backups and keep them outside of the VCS. The generation of env var files can also be included in the build process if desired. Really depends on the application/need.

Michael
~ 6 years ago

How to share environment variable files with other developers? If a developer adds an environment variable for a new feature, all other developers must set this environment variable as soon as the feature is merged into the develop branch. How to document and communicate change of environment variables? If you switch between (feature-) branches, you might need different environment variables. How to manage them if they are not tracked by the VCS? How to detect conflicts, if the same environment variable name is used in another feature branch that is merged into develop branch? You might not get a git merge conflict.