firqaaa commited on
Commit
22cae56
·
1 Parent(s): e04865c

add Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +43 -0
Dockerfile ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9
2
+
3
+ RUN apt update && \
4
+ apt install -y bash \
5
+ poppler-utils \
6
+ tesseract-ocr \
7
+ libtesseract-dev \
8
+ build-essential \
9
+ git \
10
+ curl \
11
+ ca-certificates \
12
+ python3 \
13
+ python3-pip && \
14
+ rm -rf /var/lib/apt/lists
15
+
16
+
17
+ WORKDIR /code
18
+
19
+ COPY ./requirements.txt /code/requirements.txt
20
+
21
+ # Set up a new user named "user" with user ID 1000
22
+ RUN useradd -m -u 1000 user
23
+
24
+ # Switch to the "user" user
25
+ USER user
26
+
27
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
28
+
29
+ RUN [ "python", "-c", "import nltk; nltk.download('punkt')" ]
30
+
31
+ # Set home to the user's home directory
32
+ ENV HOME=/home/user \
33
+ PATH=/home/user/.local/bin:$PATH
34
+
35
+ # Set the working directory to the user's home directory
36
+ WORKDIR $HOME/app
37
+
38
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
39
+ COPY --chown=user . $HOME/app
40
+
41
+ COPY . .
42
+
43
+ CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]