Software DevelopmentIntermediate 2 to 3 hours

Define a Multi-Container Architecture

Write a `docker-compose.yml` to spin up a Node API, Postgres database, and Redis cache.

The Scenario

A new developer joins your team. Currently, they have to manually install Node, PostgreSQL, and Redis on their laptop just to run the app locally. It takes them 2 days to set up their environment.

The Brief

Write a `docker-compose.yml` file that defines three services: `api`, `db` (PostgreSQL), and `cache` (Redis). Ensure the `api` service waits for the `db` to be ready before starting, and define persistent volumes for the database so data isn't lost on restart.

Deliverables

  • The complete `docker-compose.yml` file
  • An explanation of how Docker Compose networks allow the `api` service to connect to the database using the hostname `db`

Submission Guidance

Make sure to map the API port to the host machine so you can hit `localhost:3000` in your browser. Do not hardcode passwords in the compose file; use environment variables.

Submit Your Work

Your submission is graded against the rubric on the right. If you pass, you get a public Badge URL you can share on LinkedIn. There is no draft save, so work offline first and paste your finished response here.

This appears on your public Badge.

We'll email you the permanent link to your Badge so you never lose it. Not shown publicly.

0/20000 charactersMarkdown supported

One per line or comma separated. Up to 5 links.

Loading security check...

By submitting, you agree your submission text, name, and evaluation will appear on a public Badge URL.