flask-ocr-api / Dockerfile
vamsi1103's picture
Update Dockerfile
f0ed88f verified
Raw History Blame Contribute Delete
746 Bytes
FROM python:3.10-slim
WORKDIR /app
# Install system dependencies for OpenCV and PDF reading
RUN apt-get update && apt-get install -y \
libgl1 \
libglib2.0-0 \
libsm6 \
libxrender1 \
libxext6 \
poppler-utils \
libgomp1 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements from the CURRENT directory
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt
# Copy everything from the CURRENT directory into /app
COPY . /app/
EXPOSE 7860
# We use uvicorn with the factory pattern to avoid the 'app.py' vs 'app/' folder conflict
CMD ["uvicorn", "app:create_app", "--factory", "--host", "0.0.0.0", "--port", "7860", "--timeout-keep-alive", "300"]