DocumentOCR1 / Dockerfile
PrathameshRaut's picture
Update Dockerfile
d55c8d8 verified
Raw
History Blame Contribute Delete
678 Bytes
FROM python:3.10-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
libpoppler-cpp-dev \
libmagic1 \
fonts-dejavu-core \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy requirements
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY app.py .
COPY .env.example .env
# Expose port
EXPOSE 7860
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import requests; requests.get('http://localhost:7860/health')" || exit 1
# Run the application
CMD ["python", "app.py"]