paddleocr / Dockerfile
chipling's picture
Update Dockerfile
e24fdcc verified
raw
history blame
782 Bytes
# Use an official Python runtime as a parent image
FROM python:3.10-slim
# Set the working directory
WORKDIR /app
# Install system dependencies required by PaddleOCR and OpenCV
# ADDED: libgomp1
RUN apt-get update && apt-get install -y \
libgl1 \
libglib2.0-0 \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*
# Create a non-root user required by Hugging Face Spaces
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# Copy requirements and install
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application
COPY --chown=user . .
# Expose the port FastAPI runs on
EXPOSE 7860
# Command to run the application
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]