2

We're evaluating Docker for use in deploying our apps. What we've been unable to gleen from the Interwebs so far is how we would deal with the different runtime environments we use at our company.

To simplify, let's just say that we have a test environment and a production environment. If I were deploying Application-X to the test environment, I'd pass a command line option to Maven or Gradle that would cause it to use a particular configuration that would point it to Service-X-Test, for example.

When deploying to production, Application-X would be built with a config that points it at Service-X-Prod instead.

Can Docker handle this kind of thing, or am I entirely missing the point with Docker?

We do have a few apps that are newer and manage that configuration at runtime using Spring and Groovy scripts, but those are, sadly, the exception rather than the rule. Docker would appear to work very well with those new apps.

1 Answer 1

1

Refer to this presentation:

Lessons from using Docker to improve web developer productivity

Jump forward to 21:09 mark, the solution is to use a fixed domain name (in your case Service-X-Prod). In developer test environment, you'd configure /etc/hosts file so that traffics point to Service-X-Prod, would route to Service-X-Test instead.

I think it's a genuine solution as it achieves two things: Retain integrity of the containers by eliminates the need to reroute traffic due to environment change, and no longer the need for separate configurations for test and prod.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .