🔧(project) change env.d system by using local files

We had lot of problems with the previous env.d system.
Users were often confused by the need to change
the env.d files manually, leading to issues
when using the project locally.
This commit introduces a new system that uses
.env.local files, which are automatically created
and can be modified by users without affecting
the original env.d files. This should simplify
the development process and reduce confusion by
removing the need to manually edit env.d files.
This commit is contained in:
Manuel Raynaud
2025-08-18 11:45:52 +02:00
parent 4163b5abae
commit ca11ac0e89
7 changed files with 16 additions and 22 deletions
+1 -2
View File
@@ -40,8 +40,7 @@ venv/
ENV/ ENV/
env.bak/ env.bak/
venv.bak/ venv.bak/
env.d/development/* env.d/development/*.local
!env.d/development/*.dist
env.d/terraform env.d/terraform
# npm # npm
+8 -20
View File
@@ -66,19 +66,19 @@ data/static:
# -- Project # -- Project
create-env-files: ## Copy the dist env files to env files create-env-local-files: ## create env.local files in env.d/development
create-env-files: \ create-env-local-files:
env.d/development/common \ @touch env.d/development/crowdin.local
env.d/development/crowdin \ @touch env.d/development/common.local
env.d/development/postgresql \ @touch env.d/development/postgresql.local
env.d/development/kc_postgresql @touch env.d/development/kc_postgresql.local
.PHONY: create-env-files .PHONY: create-env-local-files
bootstrap: ## Prepare Docker images for the project bootstrap: ## Prepare Docker images for the project
bootstrap: \ bootstrap: \
data/media \ data/media \
data/static \ data/static \
create-env-files \ create-env-local-files \
build \ build \
migrate \ migrate \
back-i18n-compile \ back-i18n-compile \
@@ -212,20 +212,8 @@ resetdb: ## flush database and create a superuser "admin"
@${MAKE} superuser @${MAKE} superuser
.PHONY: resetdb .PHONY: resetdb
env.d/development/common:
cp -n env.d/development/common.dist env.d/development/common
env.d/development/postgresql:
cp -n env.d/development/postgresql.dist env.d/development/postgresql
env.d/development/kc_postgresql:
cp -n env.d/development/kc_postgresql.dist env.d/development/kc_postgresql
# -- Internationalization # -- Internationalization
env.d/development/crowdin:
cp -n env.d/development/crowdin.dist env.d/development/crowdin
crowdin-download: ## Download translated message from crowdin crowdin-download: ## Download translated message from crowdin
@$(COMPOSE_RUN_CROWDIN) download -c crowdin/config.yml @$(COMPOSE_RUN_CROWDIN) download -c crowdin/config.yml
.PHONY: crowdin-download .PHONY: crowdin-download
+7
View File
@@ -12,6 +12,7 @@ services:
retries: 300 retries: 300
env_file: env_file:
- env.d/development/postgresql - env.d/development/postgresql
- env.d/development/postgresql.local
redis: redis:
image: redis:5 image: redis:5
@@ -68,7 +69,9 @@ services:
- DJANGO_CONFIGURATION=Development - DJANGO_CONFIGURATION=Development
env_file: env_file:
- env.d/development/common - env.d/development/common
- env.d/development/common.local
- env.d/development/postgresql - env.d/development/postgresql
- env.d/development/postgresql.local
ports: ports:
- "8071:8000" - "8071:8000"
volumes: volumes:
@@ -95,7 +98,9 @@ services:
- DJANGO_CONFIGURATION=Development - DJANGO_CONFIGURATION=Development
env_file: env_file:
- env.d/development/common - env.d/development/common
- env.d/development/common.local
- env.d/development/postgresql - env.d/development/postgresql
- env.d/development/postgresql.local
volumes: volumes:
- ./src/backend:/app - ./src/backend:/app
- ./data/static:/data/static - ./data/static:/data/static
@@ -133,6 +138,7 @@ services:
- ".:/app" - ".:/app"
env_file: env_file:
- env.d/development/crowdin - env.d/development/crowdin
- env.d/development/crowdin.local
user: "${DOCKER_USER:-1000}" user: "${DOCKER_USER:-1000}"
working_dir: /app working_dir: /app
@@ -155,6 +161,7 @@ services:
- "6433:5432" - "6433:5432"
env_file: env_file:
- env.d/development/kc_postgresql - env.d/development/kc_postgresql
- env.d/development/kc_postgresql.local
keycloak: keycloak:
image: quay.io/keycloak/keycloak:26.3.2 image: quay.io/keycloak/keycloak:26.3.2