@@ -70,19 +70,23 @@ endif
70
70
@echo "Updating containers..."
71
71
docker-compose pull
72
72
@echo "Build and run containers..."
73
+ mkdir -p $(COMPOSER_HOME_CACHE)
73
74
docker-compose up -d --remove-orphans
74
75
$(call php-0, apk add --no-cache graphicsmagick tzdata $(ADD_PHP_EXT))
75
76
# Set up timezone
76
77
$(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')
77
79
$(call php-0, kill -USR2 1)
78
80
$(call php, composer global require -o --update-no-dev --no-suggest "hirak/prestissimo:^0.3")
79
81
80
82
# # Install backend dependencies
81
83
back :
84
+ mkdir -p $(COMPOSER_HOME_CACHE )
82
85
docker-compose up -d --remove-orphans --no-deps php # PHP container is required for composer
83
86
ifneq ($(strip $(ADD_PHP_EXT ) ) ,)
84
87
# Install additional php extensions as this goal used in CI (todo stop doing it)
85
88
$(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')
86
90
endif
87
91
ifeq ($(INSTALL_DEV_DEPENDENCIES ) , TRUE)
88
92
@echo "INSTALL_DEV_DEPENDENCIES=$(INSTALL_DEV_DEPENDENCIES)"
@@ -156,6 +160,10 @@ ifdef DB_MOUNT_DIR
156
160
@echo "Clean-up database data from $(DB_MOUNT_DIR) ..."
157
161
docker run --rm --user 0:0 -v $(shell dirname $(DB_MOUNT_DIR)):/mnt $(IMAGE_PHP) sh -c "rm -fr /mnt/`basename $(DB_MOUNT_DIR)`"
158
162
endif
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
159
167
ifeq ($(CLEAR_FRONT_PACKAGES ) , yes)
160
168
make clear-front
161
169
endif
0 commit comments