File size: 760 Bytes
b7484d7
 
 
 
 
 
 
 
 
 
eeebb29
b7484d7
 
 
 
 
eeebb29
 
 
 
 
b7484d7
 
 
 
 
eeebb29
b7484d7
 
 
eeebb29
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# 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 python3-opencv && \
    rm -rf /var/lib/apt/lists/*

# Create and set the working directory
RUN mkdir /var/www
RUN mkdir /var/www/tmp
RUN chmod a+w /var/www/tmp

RUN groupadd -r flaskuser && useradd -r -g flaskuser flaskuser


ENV HOME /var/www
WORKDIR /var/www
COPY . /var/www

RUN pip install --no-cache-dir -r requirements.txt
USER flaskuser
EXPOSE 7860

# Run the Flask application
CMD flask run --host=0.0.0.0 --port=7860