Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I manage composer files? #225

Open
emircanerkul opened this issue Jul 31, 2022 · 1 comment
Open

How can I manage composer files? #225

emircanerkul opened this issue Jul 31, 2022 · 1 comment

Comments

@emircanerkul
Copy link

emircanerkul commented Jul 31, 2022

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.

drupal:
  image: drupal:9.4
  volumes:
    - ../src/composer.json:/opt/drupal/composer.json
    - ../src/composer.lock:/opt/drupal/composer.lock 

WHY: To be able to easily organize files with git. Not only

  - ../src/modules:/var/www/html/modules
  - ../src/profiles:/var/www/html/profiles
  - ../src/themes:/var/www/html/themes
  - ../src/sites:/var/www/html/sites

are important. Also, composer files are needed.

@kjostling
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants