Docker Compose - Run multiple Docker containers

What is Docker Compose?

Docker Compose is a tool for defining and running multiple docker containers.

YAML file to configure your application's services:

Docker Compose automatically creates a common docker network for docker containers in it (--net option in docker run)

You can maintain and update configuration more easily than with docker run command

Starting the application with Docker Compose

✅ Step 1: start mongodb and mongo-express

You can access the mongo-express under localhost:8080 from your browser

✅ Step 2: in mongo-express UI - create a new database “my-db”

✅ Step 3: in mongo-express UI - create a new collection “users” in the database “my-db”

✅ Step 4: start node server

✅ Step 5: access the nodejs application from browser

Last updated