NitroStack Logo
/python
/deployment
/docker

Docker (Python)

Example:

Dockerfile
FROM python:3.12-slim
WORKDIR /app
COPY . .
RUN pip install --no-cache-dir nitrostack && pip install --no-cache-dir -r requirements.txt
ENV HOST=0.0.0.0 MCP_TRANSPORT_TYPE=http PORT=3000
EXPOSE 3000
CMD ["nitrostack-py", "start", "--port", "3000"]

Do not copy .env into the image. Pass secrets at runtime. pack already excludes .env from wheels.

Bash
nitrostack-py pack --dry-run
docker build -t my-mcp-server .
docker run --rm -p 3000:3000 --env-file .env my-mcp-server