-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (42 loc) · 1.39 KB
/
Dockerfile
File metadata and controls
54 lines (42 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Use NVIDIA CUDA base image for GPU support with development tools
FROM nvidia/cuda:12.4.1-devel-ubuntu22.04
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV PIP_NO_CACHE_DIR=1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
# Install system dependencies including Python and PDF processing tools
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-pip \
curl \
ca-certificates \
poppler-utils \
libpoppler-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set Python 3 as default
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
# Install uv for faster package management
RUN python -m pip install --upgrade pip && pip install uv
# Create app directory
WORKDIR /app
# Copy project files
COPY pyproject.toml ./
COPY nanonets_mcp/ ./nanonets_mcp/
COPY README.md ./
# Install Python dependencies
RUN uv pip install --system -e .
# Create non-root user for security
RUN useradd --create-home --shell /bin/bash app
RUN chown -R app:app /app
USER app
# Create directory for model cache
RUN mkdir -p /app/.cache/huggingface
# Expose port for MCP server
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "from nanonets_mcp.server import mcp; print('OK')" || exit 1
# Default command
CMD ["python", "-m", "nanonets_mcp.server"]