ocr-fastapi / Dockerfile
Sudhansh26's picture
Update Dockerfile
d527fcd verified
Raw History Blame Contribute Delete
620 Bytes
# Lightweight Python 3.10.11-slim
FROM python:3.10.11-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
tesseract-ocr \
tesseract-ocr-hin \
poppler-utils \
libgl1 \
libglib2.0-0 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Expose port 7860
EXPOSE 7860
# Run FastAPI
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]