-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (24 loc) · 723 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (24 loc) · 723 Bytes
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
# Base image
FROM python:3.8
RUN pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cpu
# Install Poppler dependencies
RUN apt-get update && apt-get install -y \
libpoppler-cpp-dev \
pkg-config \
python3-dev \
python3-pip \
poppler-utils
# Copy application code
COPY main.py /app/main.py
COPY saved_models/ /app/saved_models/
COPY src/ /app/src/
# Set working directory
WORKDIR /app
# Install Python dependencies
COPY requirements_linux.txt /app/requirements_linux.txt
RUN pip install --no-cache-dir -r /app/requirements_linux.txt
ENV PORT=8000
# Expose port
EXPOSE 8000
# Define the startup command
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]