@@ -70,19 +70,23 @@ endif
7070 @echo "Updating containers..."
7171 docker-compose pull
7272 @echo "Build and run containers..."
73+ mkdir -p $(COMPOSER_HOME_CACHE)
7374 docker-compose up -d --remove-orphans
7475 $(call php-0, apk add --no-cache graphicsmagick tzdata $(ADD_PHP_EXT))
7576 # Set up timezone
7677 $(call php-0, cp /usr/share/zoneinfo/Europe/Paris /etc/localtime)
78+ $(call php-0, sh -c '[ ! -z "$$COMPOSER_HOME" -a -d $$COMPOSER_HOME ] && chown -R $(CUID):$(CGID) $$COMPOSER_HOME')
7779 $(call php-0, kill -USR2 1)
7880 $(call php, composer global require -o --update-no-dev --no-suggest "hirak/prestissimo:^0.3")
7981
8082# # Install backend dependencies
8183back :
84+ mkdir -p $(COMPOSER_HOME_CACHE )
8285 docker-compose up -d --remove-orphans --no-deps php # PHP container is required for composer
8386ifneq ($(strip $(ADD_PHP_EXT ) ) ,)
8487# Install additional php extensions as this goal used in CI (todo stop doing it)
8588 $(call php-0, apk add --no-cache $(ADD_PHP_EXT))
89+ $(call php-0, sh -c '[ ! -z "$$COMPOSER_HOME" -a -d $$COMPOSER_HOME ] && chown -R $(CUID):$(CGID) $$COMPOSER_HOME')
8690endif
8791ifeq ($(INSTALL_DEV_DEPENDENCIES ) , TRUE)
8892 @echo "INSTALL_DEV_DEPENDENCIES=$(INSTALL_DEV_DEPENDENCIES)"
@@ -156,6 +160,10 @@ ifdef DB_MOUNT_DIR
156160 @echo "Clean-up database data from $(DB_MOUNT_DIR) ..."
157161 docker run --rm --user 0:0 -v $(shell dirname $(DB_MOUNT_DIR)):/mnt $(IMAGE_PHP) sh -c "rm -fr /mnt/`basename $(DB_MOUNT_DIR)`"
158162endif
163+ ifdef COMPOSER_HOME_CACHE
164+ @echo "Clean-up composer cache from $(COMPOSER_HOME_CACHE) ..."
165+ 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)`"
166+ endif
159167ifeq ($(CLEAR_FRONT_PACKAGES ) , yes)
160168 make clear-front
161169endif
0 commit comments