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?

1 Answer 1

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? Commented Apr 14, 2017 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. Commented Apr 14, 2017 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? Commented Apr 14, 2017 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. Commented Apr 14, 2017 at 20:46

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.