1

I'm working on a system split into multiple services. Some services (and especially the front end web server) depend on other services to function. When developing these locally, do you point to the dependencies in staging, mock them out, or run them locally?

Are there any tools to make this easier? Would it be a good idea to use docker compose or some other vm to run dependencies while developing?

2

I think Docker and Compose are definitely the way to go. We have projects that require different services (frontend, backend, Postgres, Redis, Elasticsearch, etc.) that compose a whole system. Before Docker/Compose we were running these on our local machines and struggled with juggling different versions for different projects.

Docker provides the benefit of being able to spin up environments specific to the needs of a specific project without polluting your local system. You also don't have to worry about the nuances of getting a certain package installed as most of the images on Docker Hub take care of that for you.

Also, if you're working with other people then Docker/Compose will make getting everyone up and running way easier. Rather than making sure everyone has every dependency properly installed/compiled/configured/etc. you can tell them to pull the project off GitHub and docker-compose up and they're off to the races.

4
  • So each service's docker-compose file will contain a working image for the services it depends on, but will build it's own code, correct? – Sean Clark Hess Apr 14 '17 at 0:10
  • Yes @SeanClarkHess. That's correct, but be wary. This is a good answer & I support using docker-compose for integration/manual testing, but if you're not careful you'll find yourself far too coupled to the external services. – RubberDuck Apr 14 '17 at 10:00
  • @RubberDuck What should I be on the lookout for? How could you become too coupled to the external services? Isn't the point of services to prevent tight coupling? When you say "integration/manual" testing, you mean this doesn't replace the need for automated tests that don't hit the dependency, right? – Sean Clark Hess Apr 14 '17 at 15:18
  • Yes. That's exactly what I'm saying. I'd be looking out for tests that rely on the containers being up & running. – RubberDuck Apr 14 '17 at 20:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.