docker-compose build and run code example
Example 1: docker compose run
# One single docker-compose.yml file
docker-compose up --build -d --remove-orphans
# Specify docker-compose.yml file to run
docker-compose -f docker-compose.yml up --build -d --remove-orphans
Example 2: docker-compose build
$ docker-compose -f docker-compose.dev.yml up --build
Example 3: docker compose command build
docker-compose up // not run in the background
docker-compose up -d // run in the background