docker-library / docker-library/drupal

How can I manage composer files?

Open
#225 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
291
Forks
199
Avg merge
5h 12m
Merged PRs (30d)
1

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the Drupal image currently handles /opt/drupal/composer.json and composer.lock when host bind mounts are used; the issue names no repository file or test. Done means the container copies each file only when its host-mounted counterpart is absent, while the shown docker-compose volume setup works.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose
Domain
devops
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.