File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -17,5 +17,21 @@ RUN pip install --no-cache-dir -e .
1717RUN echo "Running pre-cache to populate cache data..." && \
1818 python -m mcp_nixos --pre-cache
1919
20- # Run the MCP server
21- CMD ["python" , "-m" , "mcp_nixos" ]
20+ # Set environment variables to ensure clean exit
21+ ENV PYTHONUNBUFFERED=1
22+ ENV MCP_NIXOS_CLEANUP_ORPHANS=true
23+ # Set low timeout values for all operations
24+ ENV MCP_NIXOS_SHUTDOWN_TIMEOUT=0.1
25+ ENV MCP_NIXOS_STARTUP_TIMEOUT=1.0
26+
27+ # Use tini as init system to handle signals properly
28+ RUN apt-get update && apt-get install -y tini && rm -rf /var/lib/apt/lists/*
29+
30+ # Use tini as entrypoint for proper signal forwarding and zombie reaping
31+ ENTRYPOINT ["/usr/bin/tini" , "--" ]
32+
33+ # Run the MCP server through the run.py wrapper for better termination handling
34+ CMD ["python" , "-m" , "mcp_nixos.run" ]
35+
36+ # Add signal handler to ensure container exits cleanly
37+ STOPSIGNAL SIGTERM
You can’t perform that action at this time.
0 commit comments