rename docker-compose variables

This commit is contained in:
Jörn-Michael Miehe 2022-02-21 23:35:48 +01:00
parent 261ee7bf59
commit b30188c8dc
2 changed files with 9 additions and 9 deletions

View file

@ -31,7 +31,7 @@ services:
environment: environment:
MYSQL_ROOT_PASSWORD: changeme MYSQL_ROOT_PASSWORD: changeme
volumes: volumes:
- "${TARGETDIR}/db:/var/lib/mysql" - "${KIWI_PROJECT}/db:/var/lib/mysql"
adminer: adminer:
# admin interface for databases # admin interface for databases
@ -46,10 +46,10 @@ services:
- "8081:8080" - "8081:8080"
another-web: another-web:
# Another webserver just to show off the ${CONFIGDIR} variable # Another webserver just to show off the ${KIWI_CONFIG} variable
image: nginx:stable-alpine image: nginx:stable-alpine
restart: unless-stopped restart: unless-stopped
ports: ports:
- "8082:80" - "8082:80"
volumes: volumes:
- "${CONFIGDIR}/html/index.html:/usr/share/nginx/html/index.html:ro" - "${KIWI_CONFIG}/html/index.html:/usr/share/nginx/html/index.html:ro"

View file

@ -39,18 +39,18 @@ class Project:
directory: Path = self.directory directory: Path = self.directory
project_name: str = self.name project_name: str = self.name
kiwi_hub_name: str = self.parent_instance.config.network.name kiwi_hub_name: str = self.parent_instance.config.network.name
target_root_dir: Path = self.parent_instance.config.storage.directory kiwi_instance_dir: Path = self.parent_instance.config.storage.directory
conf_dir: Path = target_root_dir.joinpath(CONFIG_DIRECTORY_NAME) kiwi_config_dir: Path = kiwi_instance_dir.joinpath(CONFIG_DIRECTORY_NAME)
target_dir: Path = target_root_dir.joinpath(project_name) kiwi_project_dir: Path = kiwi_instance_dir.joinpath(project_name)
result: Dict[str, Any] = { result: Dict[str, Any] = {
"cwd": str(directory), "cwd": str(directory),
"env": { "env": {
"COMPOSE_PROJECT_NAME": project_name, "COMPOSE_PROJECT_NAME": project_name,
"KIWI_HUB_NAME": kiwi_hub_name, "KIWI_HUB_NAME": kiwi_hub_name,
"TARGETROOT": str(target_root_dir), "KIWI_INSTANCE": str(kiwi_instance_dir),
"CONFIGDIR": str(conf_dir), "KIWI_CONFIG": str(kiwi_config_dir),
"TARGETDIR": str(target_dir), "KIWI_PROJECT": str(kiwi_project_dir),
}, },
} }