docker compose build from scratch code example
Example 1: docker-compose force rebuild
# Build images before starting containers.
docker-compose up --build
# Recreate containers even if configuration/image hasn't changed.
docker-compose up --force-recreate
Example 2: docker compose build
web:
# build from Dockerfile
build: .
args: # Add build arguments
APP_HOME: app