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

Add local composer cache #290

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add local composer cache #290

wants to merge 1 commit into from

Conversation

andypost
Copy link
Contributor

Alternative to #278

Just keeps changes smaller, the .cache dir already exists if database defined or will be created by composer on first run

@andypost
Copy link
Contributor Author

andypost commented Oct 22, 2020

Composer 1 and 2 has different defaults for cache dir (~/.composer/cache vs ~/.cache/composer)

https://github.com/composer/composer/blob/2.0.0-RC2/doc/03-cli.md#composer_home

By default, it points to C:\Users<user>\AppData\Roaming\Composer on Windows and /Users//.composer on macOS. On *nix systems that follow the XDG Base Directory Specifications, it points to $XDG_CONFIG_HOME/composer. On other *nix systems, it points to /home//.composer.

Also each php container needs own global set of packages so we can't share its home

Makefile Outdated Show resolved Hide resolved
@andypost
Copy link
Contributor Author

For core development I'm using local mounts

    volumes:
      - ./:/var/www/html/web
      - /home/andypost/.cache/composer:/home/www-data/.composer/cache

@davidferlay
Copy link
Contributor

davidferlay commented Oct 26, 2020

For core development I'm using local mounts

    volumes:
      - ./:/var/www/html/web
      - /home/andypost/.cache/composer:/home/www-data/.composer/cache

That's cool, would $USER variable work here ?
- /home/$USER/.cache/composer:/home/www-data/.composer/cache

@andypost
Copy link
Contributor Author

I'm sure we can't bet on it as every OS it different locally https://github.com/composer/composer/blob/2.0.0-RC2/doc/03-cli.md#composer_home

So local cache place is user's preference, maybe example of it helpful, thanks will update asap

That's cool, would $USER variable work here ?
- /home/$USER/.cache/composer:/home/www-data/.composer/cache

@andypost
Copy link
Contributor Author

Still looks more viable to use https://github.com/composer/composer/blob/2.0/doc/03-cli.md#composer_cache_dir to share only cache directory

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

Successfully merging this pull request may close these issues.

2 participants