-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (38 loc) · 1.41 KB
/
Dockerfile
File metadata and controls
49 lines (38 loc) · 1.41 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
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
# Avoid interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies
# software-properties-common for add-apt-repository
# git, curl, wget for downloading resources
# ffmpeg, libsm6, libxext6 are common cv2 dependencies (often needed for OCR/Image tasks)
RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common \
git \
curl \
wget \
ffmpeg \
libsm6 \
libxext6 \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.12 \
python3.12-venv \
python3.12-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Set python3.12 as default python3
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1
# Install pip for Python 3.12
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3
WORKDIR /app
# Copy installation dependencies first to leverage Docker cache
COPY requirements.txt install.sh ./
# Make install script executable and run it
# This script installs PyTorch, vLLM, and other requirements
RUN chmod +x install.sh && ./install.sh
# Copy the rest of the application code
COPY . .
# Expose the API port
EXPOSE 8000
# Default command to run the FastAPI server
CMD ["python3", "serve_pdf.py"]