fix : correction de la conf docker
This commit is contained in:
20
makefile
20
makefile
@@ -7,6 +7,9 @@ ENV_FILE := $(if $(wildcard $(ENV_LOCAL)),$(ENV_LOCAL),$(ENV_DEFAULT))
|
||||
include $(ENV_DEFAULT)
|
||||
-include $(ENV_LOCAL)
|
||||
|
||||
HOST_UID := $(if $(SUDO_UID),$(SUDO_UID),$(shell id -u))
|
||||
HOST_GID := $(if $(SUDO_GID),$(SUDO_GID),$(shell id -g))
|
||||
|
||||
PHP_CONTAINER = php-$(DOCKER_APP_NAME)-fpm
|
||||
SYMFONY_CONSOLE = $(EXEC_PHP) php bin/console
|
||||
|
||||
@@ -24,13 +27,13 @@ FILES =
|
||||
|
||||
env-init:
|
||||
@mkdir -p docker
|
||||
@cp --update=none $(ENV_DEFAULT) $(ENV_LOCAL)
|
||||
@cp -n $(ENV_DEFAULT) $(ENV_LOCAL)
|
||||
|
||||
# Lance le container
|
||||
start: env-init
|
||||
@echo "**** START CONTAINERS ****"
|
||||
@cp --update=none docker/.env.docker docker/.env.docker.local
|
||||
CURRENT_UID=$(shell id -u) CURRENT_GID=$(shell id -g) $(DOCKER_COMPOSE) up -d
|
||||
@cp -n docker/.env.docker docker/.env.docker.local
|
||||
CURRENT_UID=$(HOST_UID) CURRENT_GID=$(HOST_GID) $(DOCKER_COMPOSE) up -d
|
||||
|
||||
# Éteint le container
|
||||
stop:
|
||||
@@ -38,7 +41,7 @@ stop:
|
||||
|
||||
restart: env-init
|
||||
$(DOCKER_COMPOSE) down
|
||||
CURRENT_UID=$(shell id -u) CURRENT_GID=$(shell id -g) $(DOCKER_COMPOSE) up -d
|
||||
CURRENT_UID=$(HOST_UID) CURRENT_GID=$(HOST_GID) $(DOCKER_COMPOSE) up -d
|
||||
|
||||
install: copy-git-hook composer-install cache-clear node-use build-nuxtJS migration-migrate
|
||||
|
||||
@@ -57,9 +60,8 @@ dev-nuxt:
|
||||
$(EXEC_PHP) sh -c "cd frontend && npm run dev"
|
||||
|
||||
delete_built_dir:
|
||||
CURRENT_UID=$(shell id -u) CURRENT_GID=$(shell id -g) $(DOCKER_COMPOSE) up -d
|
||||
$(DOCKER) exec -u root $(PHP_CONTAINER) rm -rf vendor/
|
||||
$(DOCKER) exec -u root $(PHP_CONTAINER) rm -rf frontend/node_modules
|
||||
rm -rf vendor/
|
||||
rm -rf frontend/node_modules
|
||||
|
||||
remove_orphans:
|
||||
$(DOCKER_COMPOSE) kill
|
||||
@@ -69,8 +71,8 @@ build-without-cache:
|
||||
$(DOCKER_COMPOSE) build \
|
||||
--build-arg="DOCKER_PHP_VERSION=$(DOCKER_PHP_VERSION)" \
|
||||
--build-arg="DOCKER_NODE_VERSION=$(DOCKER_NODE_VERSION)" \
|
||||
--build-arg="CURRENT_UID=$(shell id -u)" \
|
||||
--build-arg="CURRENT_GID=$(shell id -g)" \
|
||||
--build-arg="CURRENT_UID=$(HOST_UID)" \
|
||||
--build-arg="CURRENT_GID=$(HOST_GID)" \
|
||||
--no-cache
|
||||
|
||||
migration-migrate:
|
||||
|
||||
Reference in New Issue
Block a user