If you work on Linux and cannot edit some of the project files right after the first installation, you can run the following command to set yourself as owner of the project files that were created by the Docker container:
docker compose run --rm php chown -R $(id -u):$(id -g) .See the TLS section for more details.
Remember that, by default, if you run docker compose up --wait,
only the files compose.yaml and compose.override.yaml will be used.
See "How Compose works"
and "Merge Compose files".
If you need to build images for production environment, you have to use the following command:
docker compose -f compose.yaml -f compose.prod.yaml build --pull --no-cacheDev and prod images use distinct image names (app-php-dev and app-php-prod),
so they won't conflict with each other.
To build and start the dev image:
docker compose up --waitTo build and start the prod image:
docker compose -f compose.yaml -f compose.prod.yaml build --pull --no-cache
docker compose -f compose.yaml -f compose.prod.yaml up --waitWarning
The order of -f arguments matters.