Skip to content
Merged
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
20 changes: 18 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,21 @@ RUN pip install --no-cache-dir -e .
RUN echo "Running pre-cache to populate cache data..." && \
python -m mcp_nixos --pre-cache

# Run the MCP server
CMD ["python", "-m", "mcp_nixos"]
# Set environment variables to ensure clean exit
ENV PYTHONUNBUFFERED=1
ENV MCP_NIXOS_CLEANUP_ORPHANS=true
# Set low timeout values for all operations
ENV MCP_NIXOS_SHUTDOWN_TIMEOUT=0.1
ENV MCP_NIXOS_STARTUP_TIMEOUT=1.0

# Use tini as init system to handle signals properly
RUN apt-get update && apt-get install -y tini && rm -rf /var/lib/apt/lists/*

# Use tini as entrypoint for proper signal forwarding and zombie reaping
ENTRYPOINT ["/usr/bin/tini", "--"]

# Run the MCP server through the run.py wrapper for better termination handling
CMD ["python", "-m", "mcp_nixos.run"]

# Add signal handler to ensure container exits cleanly
STOPSIGNAL SIGTERM
Loading