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

[project-base] allow composer unlimited memory #635

Merged
merged 2 commits into from
Nov 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ There is a list of all the repositories maintained by monorepo, changes in log b
### [shopsys/project-base]
- [#616 - services.yml: automatic registration of classes with suffix "Repository" in namespace ShopBundle\Model\ ](https://github.com/shopsys/shopsys/pull/616)
- modify your `src/Shopsys/ShopBundle/Resources/config/services.yml`, change the resource for automatic registration of Model services from `resource: '../../Model/**/*{Facade,Factory}.php'` to `resource: '../../Model/**/*{Facade,Factory,Repository}.php'`
- set `ENV COMPOSER_MEMORY_LIMIT=-1` in base stage in your `docker/php-fpm/Dockerfile` as composer consumes huge amount of memory during dependencies installation
- see [#635 - allow composer unlimited memory](https://github.com/shopsys/shopsys/pull/635/files)

## [From 7.0.0-beta2 to v7.0.0-beta3]
### [shopsys/framework]
Expand Down
7 changes: 7 additions & 0 deletions docs/docker/docker-troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
1. [Update of Docker-compose is not Reflected](#update-of-docker-compose-is-not-reflected)
1. [Docker Sync does not Synchronize File Consistently](#docker-sync-does-not-synchronize-file-consistently)
1. [A docker container is not running](#a-docker-container-is-not-running)
1. [Composer dependencies installation fails on memory limit](#composer-dependencies-installation-fails-on-memory-limit)

If you are developing on Shopsys Framework using docker, you might run into some problems during the process.

Expand Down Expand Up @@ -144,3 +145,9 @@ In this case, you can increase the performance by deleting these volumes in your

## A docker container is not running
You can inspect what is wrong by using `docker logs <container-name>` command.

## Composer dependencies installation fails on memory limit
When `composer install` or `composer update` fails on an error with exceeding the allowed memory size, you can increase the memory limit by setting `COMPOSER_MEMORY_LIMIT` environment variable in your `docker/php-fpm/Dockerfile` or `docker-compose.yml`.

*Note: Since `7.0.0-beta4` we have set the Composer memory limit to `-1` (which means unlimited) in the php-fpm's `Dockerfile`.*
*If you still encounter memory issues while using Docker for Windows (or Mac), try increasing the limits in `Docker -> Preferences… -> Advanced`.*
3 changes: 3 additions & 0 deletions project-base/docker/php-fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ USER www-data
# hirak/prestissimo makes the install of Composer dependencies faster by parallel downloading
RUN composer global require hirak/prestissimo

# set COMPOSER_MEMORY_LIMIT to -1 (i.e. unlimited - this is a hotfix until https://github.com/shopsys/shopsys/issues/634 is solved)
ENV COMPOSER_MEMORY_LIMIT=-1

########################################################################################################################

FROM base as development
Expand Down