Skip to content

Commit 188b807

Browse files
committed
feat(NGUI-370): MCP Containerfile
1 parent 53f7578 commit 188b807

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

libs/next_gen_ui_mcp/BUILD

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,15 @@ python_distribution(
6969
long_description_path="libs/next_gen_ui_mcp/README.md",
7070
generate_setup=True,
7171
)
72+
73+
docker_image(
74+
name="docker",
75+
source="Containerfile",
76+
repository="next_gen_ui/mcp",
77+
image_tags=[env("VERSION"), "latest"],
78+
dependencies=[
79+
":lib",
80+
":dist",
81+
"libs/next_gen_ui_agent:dist",
82+
],
83+
)

libs/next_gen_ui_mcp/Containerfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Next Gen UI MCP Server
2+
3+
# Build:
4+
# podman run --rm -it next_gen_ui/mcp:latest
5+
6+
FROM registry.access.redhat.com/ubi9/python-312-minimal:9.6
7+
8+
# Set work directory
9+
WORKDIR /opt/app-root/src
10+
11+
# Set environment variables for build
12+
ENV PYTHONDONTWRITEBYTECODE=1 \
13+
PYTHONUNBUFFERED=1 \
14+
PIP_NO_CACHE_DIR=1
15+
16+
17+
# Copy Python Project Files (Container context must be the `python` directory)
18+
COPY --chown=1001:root . /opt/app-root/src/
19+
20+
USER root
21+
22+
# Install dependencies
23+
RUN pip install *.whl \
24+
langchain_openai
25+
26+
# Allow non-root user to access the everything in app-root
27+
RUN chgrp -R root /opt/app-root/src && chmod -R g+rwx /opt/app-root/src
28+
29+
30+
ENV MCP_TRANSPORT="streamable-http"
31+
ENV MCP_HOST="0.0.0.0"
32+
ENV MCP_PORT="5000"
33+
ENV NGUI_COMPONENT_SYSTEM="json"
34+
ENV NGUI_PROVIDER="langchain"
35+
ENV NGUI_PROVIDER_API_KEY=""
36+
ENV NGUI_MODEL="gpt-4o"
37+
ENV NGUI_PROVIDER_LLAMA_URL=""
38+
39+
40+
# Expose default port (change if needed)
41+
EXPOSE $MCP_PORT
42+
43+
USER 1001
44+
45+
# Run the MCP
46+
CMD python -m next_gen_ui_mcp --host "$MCP_HOST" --port "$MCP_PORT" --transport "$MCP_TRANSPORT" --component-system "$NGUI_COMPONENT_SYSTEM" \
47+
--provider "$NGUI_PROVIDER" --model "$NGUI_MODEL" --api-key "$NGUI_PROVIDER_API_KEY" \
48+
--llama-url "$NGUI_PROVIDER_LLAMA_URL"

pants.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ backend_packages.add = [
88
"pants.backend.python.lint.flake8",
99
"pants.backend.python.lint.isort",
1010
"pants.backend.python.typecheck.mypy",
11+
"pants.backend.docker",
1112
]
1213
pants_ignore = [
1314
"requirements_dev.txt"

0 commit comments

Comments
 (0)