# Use a base image that supports Python and includes Tesseract | |
FROM python:3.9-slim | |
# Set environment variables | |
ENV PYTHONUNBUFFERED 1 | |
ENV FLASK_APP app.py | |
ENV APP_HOME /app | |
# Install Tesseract and its dependencies | |
RUN apt-get update && apt-get install --no-install-recommends -y \ | |
tesseract-ocr \ | |
tesseract-ocr-rus poppler-utils && \ | |
rm -rf /var/lib/apt/lists/* | |
# Create and set the working directory | |
RUN mkdir /var/www | |
RUN mkdir /var/www/tmp | |
ENV HOME /var/www | |
WORKDIR /var/www | |
COPY . /var/www | |
RUN pip install --no-cache-dir -r requirements.txt | |
EXPOSE 7860 | |
# Run the Flask application | |
CMD flask run --host=0.0.0.0 --port=7860 | |