prevent plugin volume to have ownerships overwritten by docker

This commit is contained in:
asus
2024-02-06 15:46:43 +01:00
parent 00473e1288
commit 24aac70ac8
4 changed files with 27 additions and 4 deletions

View File

@@ -33,7 +33,8 @@ SOURCE_ENV := . $(ENV_PATH)
# list of volumes
VOLUME_ENV := set | grep "^HOST_VOLUME_" | cut -d "=" -f 2
VOLUMES_D = $(shell $(SOURCE_ENV) ; $(VOLUME_ENV) )
VOLUMES_D += $(shell $(SOURCE_ENV) ; echo $$HOST_VOLUMES_DIR )
ERASE_VOLUMES_D = $(shell $(SOURCE_ENV) ; echo $$HOST_VOLUMES_DIR )
VOLUME_PLUGINS_D = $(shell $(SOURCE_ENV) ; echo $$HOST_VOLUME_PLUGINS )
# url for wordpress, use in makefile to change local
WP_URL = $(shell $(SOURCE_ENV) ; echo $$WP_URL )
WP_COMPLETE_URL = $(shell $(SOURCE_ENV) ; echo $$WP_COMPLETE_URL )
@@ -88,7 +89,11 @@ build_logs:
# before starting the containers with up,
# creating a README.md file inside some binded volumes dir
# to avoid them having their ownership overwritten by docker
up:
echo "this is a binded docker volume for plugins" >> ${VOLUME_PLUGINS_D}/README.md
docker compose -f $(COMPOSE_FILE) up -d
@echo $(B_PURPLE)"you can now connect at "$(B_YELLOW)"https://$(WP_COMPLETE_URL)"$(B_PURPLE)" or 127.0.0.1"$(RESET)
down:
@@ -128,11 +133,11 @@ re: fclean all
# !! remove everything everything
# !! remove everything, also local volumes
# execpt the plugin volume
erase_volume:
- rm -rf $(VOLUMES_D)
- rm -rf $(ERASE_VOLUMES_D)
erase: fclean erase_volume
- rm -rf $(VOLUMES_D)
new: erase all