Skip to content

feat: Introduce Docker Compose for application setup and install Dock…#319

Open
dasein108 wants to merge 2 commits intomainfrom
feat-mcp-in-docker
Open

feat: Introduce Docker Compose for application setup and install Dock…#319
dasein108 wants to merge 2 commits intomainfrom
feat-mcp-in-docker

Conversation

@dasein108
Copy link
Collaborator

@dasein108 dasein108 commented Jan 26, 2026

User description

…er CLI tools within the Dockerfile.

Summary by CodeRabbit

  • Chores
    • Added image metadata labels describing the service and default behavior.
    • Included Docker CLI and compose tooling in the image.
    • Streamlined install and build sequence to improve image setup.
    • Adjusted dependency post-install handling to ensure native binaries are available.
    • Simplified default start command and removed redundant startup instructions.

✏️ Tip: You can customize this high-level summary in your review settings.


CodeAnt-AI Description

Add Docker CLI, Docker Compose, bash, and image metadata to the application image

What Changed

  • The container image now includes Docker CLI, Docker Compose, and bash so Docker and Compose commands can be executed from inside the container
  • Image carries metadata (name, version, default command, and suggested bind mounts including the Docker socket and a host Documents path) to make tooling and orchestration easier to discover
  • An environment flag is set to indicate Docker client availability (MCP_CLIENT_DOCKER=true); the container's default startup command remains the built Node app

Impact

✅ Run Docker and Compose commands inside the container
✅ Easier in-container debugging with bash available
✅ Simpler Docker-based local development via image metadata suggesting socket and file mounts

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@codeant-ai
Copy link
Contributor

codeant-ai bot commented Jan 26, 2026

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 26, 2026

📝 Walkthrough

Walkthrough

Updated the Dockerfile to add rich image metadata (LABEL), install Docker CLI and docker-cli-compose, run npm install with --ignore-scripts plus a post-install npm rebuild for @vscode/ripgrep, retain source copy and build (npm run build), and set a single JSON-formatted CMD to run node dist/index.js.

Changes

Cohort / File(s) Summary
Dockerfile
Dockerfile
Added LABEL metadata (name, version, description, command, mounts); installed Docker CLI and docker-cli-compose via apk; added npm install --ignore-scripts and npm rebuild @vscode/ripgrep``; retained COPY . . and `RUN npm run build`; unified startup with `CMD ["node", "dist/index.js"]`.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I hopped into the Docker lair, 🎩🐇
Added labels, tools, and tidy care,
Rebuilt a ripgrep binary with delight,
One CMD to start into the night,
Image ready — snug and light. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is partially related to the changeset but is incomplete and truncated, making it difficult to understand the full scope of changes. Complete the title to clearly convey the main change. Example: 'feat: Add Docker CLI and Compose support to Dockerfile' or similar concise phrasing that captures the primary objective.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codeant-ai codeant-ai bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Jan 26, 2026
@codeant-ai
Copy link
Contributor

codeant-ai bot commented Jan 26, 2026

Nitpicks 🔍

🔒 No security issues identified
⚡ Recommended areas for review

  • Host Docker control
    The image installs the Docker CLI/compose tools. If this container is ever run with the host Docker socket mounted (e.g. /var/run/docker.sock), those CLI tools allow full control over the host Docker daemon and containers, effectively giving host-level access. Confirm the intended runtime model and either avoid shipping the Docker CLI or document strict runtime constraints.

  • Image size & attack surface
    Installing docker tooling and bash in the final image increases image size and attack surface. There is no multi-stage build to keep only runtime artifacts in the final image. Consider a multi-stage build to avoid shipping build-time and auxiliary tooling.

  • Package availability / reproducibility
    The APK package names (e.g., docker-cli, docker-cli-compose) may differ between Alpine repositories or require extra repos. Also npm install is used instead of a reproducible install command (npm ci). Verify packages are available in the selected base image and prefer reproducible install steps for consistent builds.

@codeant-ai
Copy link
Contributor

codeant-ai bot commented Jan 26, 2026

CodeAnt AI finished reviewing your PR.

@codeant-ai
Copy link
Contributor

codeant-ai bot commented Jan 27, 2026

CodeAnt AI is running Incremental review


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai bot added size:S This PR changes 10-29 lines, ignoring generated files and removed size:XS This PR changes 0-9 lines, ignoring generated files labels Jan 27, 2026
@codeant-ai
Copy link
Contributor

codeant-ai bot commented Jan 27, 2026

Sequence Diagram

The PR updates the Dockerfile so the image installs Docker CLI, Docker Compose and bash, embeds runtime metadata, and still starts the Node app. The diagram shows the build producing an image with Docker tooling and the container starting the app while allowing in-container Docker commands.

sequenceDiagram
    participant Dev
    participant CI_Builder
    participant Image
    participant Container
    participant NodeApp

    Dev->>CI_Builder: Push Dockerfile changes (add docker-cli, compose, bash, metadata, CMD)
    CI_Builder->>Image: Build image (apk add docker-cli/docker-compose, set LABEL, npm build)
    CI_Builder-->>Dev: Image produced
    Dev->>Container: Run image
    Container->>Image: Start with CMD ["node","dist/index.js"]
    Container->>NodeApp: Launch Node app (runs as before)
    Note over Container,Dev: Docker CLI & Compose + bash are available inside the running container for in-container commands
Loading

Generated by CodeAnt AI

@codeant-ai
Copy link
Contributor

codeant-ai bot commented Jan 27, 2026

CodeAnt AI Incremental review completed.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@Dockerfile`:
- Around line 6-23: The Docker label io.docker.server.metadata embeds a
user-specific host path (/Users/dasein/Documents) and a Docker socket mount
which is non‑portable and leaks sensitive info; replace the hardcoded host path
with a generic placeholder (e.g. "<HOST_DOCUMENTS_PATH>") in the "mounts" entry
and update the label description to instruct users to override that placeholder
when running the image, and add a clear note in the image metadata or project
docs that binding /var/run/docker.sock is a privileged, dev‑only, opt‑in action;
ensure changes are made around the LABEL io.docker.server.metadata block so
consumers can configure mounts at runtime.

Comment on lines +6 to +23
LABEL io.docker.server.metadata='{ \
"name": "desktop-commander", \
"version": "1.0.0", \
"description": "Desktop Commander MCP Server", \
"command": ["node", "dist/index.js"], \
"mounts": [ \
{ \
"source": "/var/run/docker.sock", \
"target": "/var/run/docker.sock", \
"type": "bind" \
}, \
{ \
"source": "/Users/dasein/Documents", \
"target": "/home/Documents", \
"type": "bind" \
} \
] \
}'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Avoid embedding user-specific host paths in image metadata.

The label currently hardcodes /Users/dasein/Documents, which leaks a real username and is non-portable across hosts/OSes. Consider using a placeholder path and documenting how users should override it. Also, note that mounting the Docker socket grants host‑level control; make sure this is clearly documented as dev‑only/opt‑in.

🛠️ Suggested adjustment
-    { \
-    "source": "/Users/dasein/Documents", \
-    "target": "/home/Documents", \
-    "type": "bind" \
-    } \
+    { \
+    "source": "/path/to/Documents", \
+    "target": "/home/Documents", \
+    "type": "bind" \
+    } \
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
LABEL io.docker.server.metadata='{ \
"name": "desktop-commander", \
"version": "1.0.0", \
"description": "Desktop Commander MCP Server", \
"command": ["node", "dist/index.js"], \
"mounts": [ \
{ \
"source": "/var/run/docker.sock", \
"target": "/var/run/docker.sock", \
"type": "bind" \
}, \
{ \
"source": "/Users/dasein/Documents", \
"target": "/home/Documents", \
"type": "bind" \
} \
] \
}'
LABEL io.docker.server.metadata='{ \
"name": "desktop-commander", \
"version": "1.0.0", \
"description": "Desktop Commander MCP Server", \
"command": ["node", "dist/index.js"], \
"mounts": [ \
{ \
"source": "/var/run/docker.sock", \
"target": "/var/run/docker.sock", \
"type": "bind" \
}, \
{ \
"source": "/path/to/Documents", \
"target": "/home/Documents", \
"type": "bind" \
} \
] \
}'
🤖 Prompt for AI Agents
In `@Dockerfile` around lines 6 - 23, The Docker label io.docker.server.metadata
embeds a user-specific host path (/Users/dasein/Documents) and a Docker socket
mount which is non‑portable and leaks sensitive info; replace the hardcoded host
path with a generic placeholder (e.g. "<HOST_DOCUMENTS_PATH>") in the "mounts"
entry and update the label description to instruct users to override that
placeholder when running the image, and add a clear note in the image metadata
or project docs that binding /var/run/docker.sock is a privileged, dev‑only,
opt‑in action; ensure changes are made around the LABEL
io.docker.server.metadata block so consumers can configure mounts at runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant