@@ -66,15 +66,22 @@ endif
6666 @echo "Updating containers..."
6767 docker-compose pull
6868 @echo "Build and run containers..."
69+ mkdir -p $(COMPOSER_HOME_CACHE)
6970 docker-compose up -d --remove-orphans
7071 $(call php-0, apk add --no-cache graphicsmagick $(ADD_PHP_EXT))
72+ $(call php-0, sh -c '[ ! -z "$$COMPOSER_HOME" -a -d $$COMPOSER_HOME ] && chown -R $(CUID):$(CGID) $$COMPOSER_HOME')
7173 $(call php-0, kill -USR2 1)
7274 $(call php, composer global require -o --update-no-dev --no-suggest "hirak/prestissimo:^0.3")
7375
7476# # Install backend dependencies
7577back :
78+ mkdir -p $(COMPOSER_HOME_CACHE )
7679 docker-compose up -d --remove-orphans php # PHP container is required for composer
77- ifeq ($(INSTALL_DEV_DEPENDENCIES ) , TRUE)
80+ $(call php-0, apk add --no-cache $(ADD_PHP_EXT ) )
81+ $(call php-0, sh -c '[ ! -z "$$COMPOSER_HOME" -a -d $$COMPOSER_HOME ] && chown -R $(CUID ) :$(CGID ) $$COMPOSER_HOME')
82+ $(call php-0, kill -USR2 1)
83+ $(call php, composer global require -o --update-no-dev --no-suggest "hirak/prestissimo:^0.3")
84+ ifdef INSTALL_DEV_DEPENDENCIES
7885 @echo "INSTALL_DEV_DEPENDENCIES=$(INSTALL_DEV_DEPENDENCIES)"
7986 @echo "Installing composer dependencies, including dev ones"
8087 $(call php, composer install --prefer-dist -o)
@@ -146,6 +153,10 @@ ifdef MYSQL_DIR
146153 @echo "Removing mysql data from $(MYSQL_DIR) ..."
147154 docker run --rm --user 0:0 -v $(shell dirname $(MYSQL_DIR)):/mnt $(IMAGE_PHP) sh -c "rm -fr /mnt/`basename $(MYSQL_DIR)`"
148155endif
156+ ifdef COMPOSER_HOME_CACHE
157+ @echo "Clean-up composer cache from $(COMPOSER_HOME_CACHE) ..."
158+ docker run --rm --user 0:0 -v $(shell dirname $(abspath $(COMPOSER_HOME_CACHE))):/mnt $(IMAGE_PHP) sh -c "rm -fr /mnt/`basename $(COMPOSER_HOME_CACHE)`"
159+ endif
149160ifeq ($(CLEAR_FRONT_PACKAGES ) , yes)
150161 make clear-front
151162endif
0 commit comments