Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 💥 Allow creating multiple instances of app containers #1789

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

CLHatch
Copy link
Contributor

@CLHatch CLHatch commented Sep 18, 2024

Purpose
Allow creating multiple instances of built-in apps without using an override.

Approach
Replace all references of the app's name in templates in ~/.docker/compose/.apps to <appname> and <APPNAME>.
On run, copy the folders of apps being used to ~/.docker/compose/.instances, using folder names similar to below.:

.instances/radarr
.instances/radarr__radarr4k

The "appname" variables in the files in these folders will be replaced by the folder name (<appname> in lower case, <APPNAME> in upper case).

We will then use the .instances folder instead of the .apps folder when creating the .env file, and when calling Docker Compose.

The service names and container names of the instances will match the folder names, to avoid possible conflicts with names of other built-in apps (in the above example, both service name and container name of the radarr4k instance would be radarr__radarr4k). The user could then choose to change the container name to something else if they wish in the .env file (for example, RADARR__RADARR4K__CONTAINER_NAME='radarr4k'). This would allow the user to use a shorter name for Docker commands and network references (for example, docker stop radarr4k and http://radarr4k:7878 instead of docker stop radarr__radarr4k and http://radarr__radarr4k:7878). The service name will remain unchanged.

The format of the app variable names will be changed slightly, going from a single underscore before the start of the variable part to two underscores. We will attempt to migrate existing old variables to the new naming when they are encountered. The general format is <APPNAME>__<VARIABLE> or <APPNAME>__<INSTANCENAME>__<VARIABLE> (i.e. RADARR__CONTAINER_NAME or RADARR__RADARR4K__CONTAINER_NAME).

Open Questions and Pre-Merge TODOs
Check all boxes as they are completed

Use github checklists. When solved, check the box and explain the answer.
Learning
Describe the research stage
Links to blog posts, patterns, libraries or addons used to solve this problem

Requirements
Check all boxes as they are completed

These changes meet the standards for contributing.
I have read the code of conduct.

@github-actions github-actions bot added apps Automatic label docs Automatic label labels Sep 18, 2024
@CLHatch CLHatch self-assigned this Sep 18, 2024
@CLHatch CLHatch added enhancement New feature or request work-in-progress Stale Exempt labels Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apps Automatic label docs Automatic label enhancement New feature or request work-in-progress Stale Exempt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant