Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .claude/commands/implement-container-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ Follow closely the architectural patterns described in the `docker/guidelines.md

- Read the `docker/guidelines.md` file for the architectural patterns you must follow.
- Read the INSTALL_INSTRUCTIONS_FILE file and use its content to create the compose file in the required structure. Abort if the file is not specified or does not exist.
- If the installation instructions contain steps to fetch the Compose setup and/or environment variables from a git repository:
- Shallow clone that repository to /tmp/infra/container/<application>/ and look at the referenced compose and .env files there.
- Use the compose and .env files without any changes.
- If there are additional configuration files, which are referenced in the compose file, copy them.
- Keep the cloned repository.
- For each container image used in the deployment, get the most specific tag (e.g. tag "1.2.0" is more specific than "1.2") by using the `get-most-specific-container-tag` MCP tool. Use the tag(s) returned by the tool in the Compose stack.
- Based on these patterns and the found examples on the installation instructions page, create the Docker Compose file and save it as `docker/<category>/<application>.yaml`.
- Ensure the compose file contains a brief description of the project and links to the homepage, GitHub page, and any Docker or Docker Compose setup example (if available).
- If the installation guide suggests enhancements (e.g., using an optional external database instead of a built-in one, or enabling SSO), add TODOs at the top of the compose file.
Expand Down
23 changes: 15 additions & 8 deletions .claude/commands/plan-container-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,27 @@ INSTALL_INSTRUCTIONS_URL: $ARGUMENTS

Your task is to collect all necessary know-how for deploying a containerized application using Docker Compose.

### Part 1 - Gather information
### Part 1 - Look for installation details

Visit the installation instructions page for APPLICATION_NAME at INSTALL_INSTRUCTIONS_URL and search for Docker Compose deployment examples in this priority order:

1. Docker Compose setup located in the git repository (if the install instructions refer to cloning a repo)
2. Docker Compose setup described on the installation instructions page
3. Plain docker setup (`docker run ...`)

Gather all information relevant to container deployment.
ABORT your work if no container-based installation method is found.

### Part 2 - Gather application metadata

- Visit the installation instructions page for APPLICATION_NAME at INSTALL_INSTRUCTIONS_URL and search for Docker Compose deployment examples. If none are found, fall back to plain Docker examples. Gather all information relevant to container deployment.
- ABORT your work if no container-based installation method is found.
- Starting from the installation page, find the application's main homepage and its GitHub repository page (if available).
- For each container image used in the deployment, get the most specific tag (e.g. tag "1.2.0" is more specific than "1.2") by using the `get-most-specific-container-tag` MCP tool. Use the tag returned by the tool.
- Use the `get-container-categories` MCP tool to list subfolders under the `docker` directory and select an existing category (folder) that fits the application. Do not create a new category; use the "tools" category as a fallback if no good match is found.
- Use the `get-dashboard-groups` MCP tool to list the available dashboard groups. Select the best matching. Do not create a new group; use the "Tools" group as a fallback if no good match is found.
- Use the `get-app-icon` MCP tool to determine the application's dashboard icon (use the tool output as-is).

### Part 2 - Organize information
### Part 3 - Organize information

Do not save the Docker Compose stack as a separate yaml file yet, only create a markdown document.
Do not save the Docker Compose stack as a separate yaml file yet, only create a Markdown document. If the Compose stack uses additional configuration files, include them.
Fill the following template with the gathered information. THINK HARD to provide the best possible results.
Save the filled template as a file with the filename `docs/PRPs/containers/<application>.md`

Expand All @@ -32,7 +40,6 @@ Application name: <APPLICATION_NAME>
Homepage: <Main website, if available>
GitHub page: <GitHub page, if available>
Install instructions URL: <INSTALL_INSTRUCTIONS_URL>
Container image(s): <Container image of the service (or multiple images if the application consists of multiple services)>
Category: <Subfolder name under the `docker` directory>
Dashboard Icon: <Dashboard icon determined by `get-app-icon`>
Dashboard Group: <Dashboard group, the best matching value returned by `get-dashboard-groups`>
Expand All @@ -45,7 +52,7 @@ Long description: <Describe the application in 1–3 sentences. Optimally use th

```

### Part 3 - Instructions for implementation
### Part 4 - Instructions for implementation

As a final step write to the user:

Expand Down
31 changes: 21 additions & 10 deletions docker/Taskfile.docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,28 @@ tasks:
update-example-env:
desc: Create/update Docker example environment configuration files
dotenv: ['config/docker/.env']
env:
CONFIG_DIR: "config/docker"
EXAMPLE_DIR: "config-example/docker"
SCRIPT: "scripts/update-example-env.py"
silent: true
cmds:
- scripts/update-example-env.py config/docker/.env > config-example/docker/.env
- scripts/update-example-env.py config/docker/${MAIN_NODE}/.env > config-example/docker/myhost/.env
- cat config/docker/${MAIN_NODE}/services.yaml | sed "s/${MAIN_NODE}/myhost/g" > config-example/docker/myhost/services.yaml
# Process .env files
- |
SOURCE_HOSTDIR="${CONFIG_DIR}/${MAIN_NODE}"
TARGET_HOSTDIR="${EXAMPLE_DIR}/myhost"
mkdir -p "${TARGET_HOSTDIR}"
python3 "$SCRIPT" ${CONFIG_DIR}/.env ${EXAMPLE_DIR}/.env
find "$SOURCE_HOSTDIR" -type f -name '.env*' | while read -r env_file; do
target_filename="${env_file//$SOURCE_HOSTDIR/$TARGET_HOSTDIR}"
mkdir -p "$(dirname "$target_filename")"
echo "Processing: $env_file -> $target_filename"
python3 "$SCRIPT" "$env_file" "$target_filename"
done
# Process services.yaml, services-schema.yaml
- sed "s/${MAIN_NODE}/myhost/g" config/docker/${MAIN_NODE}/services.yaml > config-example/docker/myhost/services.yaml
- cp config/docker/services-schema.yaml config-example/docker/services-schema.yaml
sources:
- config/docker/**/.env
- config/docker/**/services.yaml
- config/docker/services-schema.yaml
- config/docker/**
generates:
- config-example/docker/.env
- config-example/docker/myhost/.env
- config-example/docker/myhost/services.yaml
- config-example/docker/services-schema.yaml
- config-example/docker/**
10 changes: 8 additions & 2 deletions scripts/update-example-env.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,18 @@ def mask_sensitive_variables(input_file: str) -> str:

def main() -> None:
if len(sys.argv) < 2:
print("Usage: ./update-example-env.py <input_env_file>")
print("Usage: ./update-example-env.py <input_env_file> [output_env_file]")
return

input_file = sys.argv[1]
output = mask_sensitive_variables(input_file)
print(output)

if len(sys.argv) == 3:
output_file = sys.argv[2]
with open(output_file, 'w') as f:
f.write(output)
else:
print(output)


if __name__ == "__main__":
Expand Down