DEV Community

Cover image for How to Docker Compose a developer environment: an open source example

How to Docker Compose a developer environment: an open source example

Dan Lebrero on October 02, 2017

This article originally appeared on my blog As we mentioned in a previous blog post, you should strive to have a simple and repeatable way of sett...
Collapse
 
prees1 profile image
Philip Rees • Edited

Instead of adding entries to your local /etc/hosts file. You could use readme.localtest.me/

and use t1.lumen.localtest.me and admin.lumen.localtest.me during development.

Collapse
 
danlebrero profile image
Dan Lebrero

Love it! What a nifty idea. I will give it a try.

Collapse
 
jaapio profile image
Jaap van Otterdijk

Or try to use a dsnmasq solution polderknowledge.nl/2017/02/16/dock...

Collapse
 
danfromisrael profile image
Dan Mordechay

Very nice article!
I was trying to do a similar setup and also ran into a problem with dependencies startup.
I still didn't have time but its worth looking into dockers health check feature
Looks like exactly what we need.
Maybe thats the next blog post?
😉

Collapse
 
danlebrero profile image
Dan Lebrero

In version 2.1 of docker compose, there was a condition option on the depends_on which was removed on version 3.

The 3.0 version states:

“Version 3 no longer supports the condition form of depends_on.“

And points again to docs.docker.com/compose/startup-or...

So I think we are out of luck right now, but let me if you find a sensible way!

Collapse
 
danfromisrael profile image
Dan Mordechay
Thread Thread
 
danlebrero profile image
Dan Lebrero

That is what Docker Compose v2.1 was using on the condition option on the depends_on, and that is what Docker Compose v3 removed.

Of course, I may be wrong, so by all means please investigate and let me know!

Thread Thread
 
danfromisrael profile image
Dan Mordechay • Edited

i think you're right about depends_on but we might be lucky with healthcheck:
docs.docker.com/compose/compose-fi...
(this will only tell us an indication if the container is healthy or not).
here's an example to try (docker not docker-compose):
github.com/tomwillfixit/healthcheck

also, i was trying to find depends_on with v3 out there in the wild and found this example:
github.com/Eficode/Docker-Selenium...

so i must say i'm confused.
i hope i'll have the time to play with it myself soon to figure it out

Thread Thread
 
danlebrero profile image
Dan Lebrero

Please let me know if you find anything!

Collapse
 
jrock2004 profile image
John Costanzo • Edited

The other issue you can run into is the more files and folders that go into the m2 the more it can slow down your container. The reason being its more files for it to monitor on both the container and the host side

Also ~/.m2:/root/.m2 will that tilda work on windows hosts?

Collapse
 
danlebrero profile image
Dan Lebrero • Edited

Great tip! Thanks a lot!

Not sure about the tilda. Nobody is using Windows over here :)

Collapse
 
terceranexus6 profile image
Paula

Very useful thanks!

Collapse
 
danlebrero profile image
Dan Lebrero

You are welcome!