Open emircanerkul opened 2 years ago
You don't manage them at you host, you manage them in your repo.
Composer files are a part of what defines your app. Your app is built into an image using a Dockerfile. The image is used by docker to create containers that are hosted. Containers should define volumes for paths in your app that contains persistent data, ie web/sites/default/files (drupal standard).
drupal:
image: my-drupal-site:9.4
volumes:
- site_data:/opt/drupal/web/sites/default/files
How can I manage composer.json and composer.lock files that hosting under /opt/drupal that I can't use volume mount these files without creating exact one in host machine (or at least I don't know).
Logic: copy composer.(json|lock) from container /opt/drupal/composer.(json|lock) if not in the host machine.
After that volume binding will work.
WHY: To be able to easily organize files with git. Not only
are important. Also, composer files are needed.