Skip to content

Commit

Permalink
Merge pull request #41 from openradx/Optional-compose-project-prefix
Browse files Browse the repository at this point in the history
Add option to set prefix for compose project and container names
  • Loading branch information
medihack authored Nov 18, 2024
2 parents bfcbbb8 + 8ad08d9 commit 5d1a053
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion adit_radis_shared/invoke_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ def get_compose_env_file():
return Utility.get_project_dir() / "docker-compose.dev.yml"

@staticmethod
def get_stack_name():
def get_stack_name() -> str:
config = Utility.load_config_from_env_file()
if stack_name := config.get("STACK_NAME", ""):
return stack_name

if Utility.is_production():
return f"{Utility.get_project_name()}_prod"
return f"{Utility.get_project_name()}_dev"
Expand Down
5 changes: 5 additions & 0 deletions example.env
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,8 @@ SSL_CHAIN_FILE="./chain.pem"

# The timezone that the web interface uses.
USER_TIME_ZONE="Europe/Berlin"

# An optional name of the stack (or compose project in development).
# When not set it defaults to the project name with suffix "_dev" resp. "_prod".
# For ADIT "adit_dev" and "adit_prod". For RADIS "radis_dev" and "radis_prod".
STACK_NAME=

0 comments on commit 5d1a053

Please sign in to comment.