File size: 1,127 Bytes
8ef5a0f
6272fe5
8ef5a0f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b776295
8ef5a0f
 
 
 
 
dc12774
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
32
33
34
35
36
37
38
39
40
41
42
43
44
# Use the official Python image as base image
FROM python:3.9-slim

RUN apt-get update && apt-get install -y \
    python3.10 python3-pip \
    tesseract-ocr \
    libtesseract-dev \
    libgl1-mesa-glx \
    poppler-utils \
    && rm -rf /var/lib/apt/lists/*

# Set the working directory in the container
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y libgl1-mesa-glx

# Copy the dependencies file to the working directory
COPY requirements.txt .

# Install dependencies
RUN pip install --trusted-host pypi.python.org -r requirements.txt

# Copy the content of the local src directory to the working directory
COPY . .

# Create a user to run the application
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

# Set the working directory in the user's home directory
WORKDIR $HOME/app
COPY --chown=user . $HOME/app

# Expose the port number on which the Flask app will run
EXPOSE 8080

# Define environment variable
ENV NAME World

# Command to run on container start
CMD [ "gunicorn", "-b", "0.0.0.0:8080", "librarymed.app_librarymed:app" ]