ocr / Dockerfile
borreooo's picture
Fix package name for newer Debian
704a009
Raw
History Blame Contribute Delete
671 Bytes
FROM python:3.11-slim
# Install system dependencies required for OpenCV and pyzbar (barcodes)
RUN apt-get update && apt-get install -y \
libgl1 \
libglib2.0-0 \
libzbar0 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy requirements and install
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir fastapi uvicorn python-multipart
# Copy all project files
COPY . .
# Create directories if they don't exist
RUN mkdir -p temp_uploads results images/barcode images/chassis
# Expose FastAPI port
EXPOSE 7860
# Start application
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]