1 min read 121 words Updated Sep 24, 2026 Created Sep 24, 2026
#Programming

Used for building apps with multiple containers.
Docker compose enables you to use Docker without a Dockerfile entirely.

Basics commands

Build: docker compose build

Build without cache: docker compose build --no-cache

Building + start: docker compose up --build

Starting a single service in your docker compose configuration: docker compose up myservice

Running a .yml file, other than the default docker-compose.yml: docker compose up dev-docker-compose.yml

Removing orphans: docker compose down --remove-orphans

Environment variables

Docker will automatically consume envs from an .env file in the root of the project like this:

    environment:
      - NODE_ENV=${NODE_ENV}

Networks

For the default hostname of an service, the service name is used, not the container name. For more on Docker Networks see: Networks.