faridans27 commited on
Commit
53a062c
1 Parent(s): 88ddc0a

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +48 -0
Dockerfile ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ libglib2.0-0=2.50.3-2 \
15
+ libnss3=2:3.26.2-1.1+deb9u \
16
+ libgconf-2-4=3.2.6-4+b1 \
17
+ libfontconfig1=2.11.0-6.7+b1
18
+ rm -rf /var/lib/apt/lists
19
+
20
+ RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
21
+
22
+ WORKDIR /code
23
+
24
+ COPY ./requirements.txt /code/requirements.txt
25
+
26
+ # Set up a new user named "user" with user ID 1000
27
+ RUN useradd -m -u 1000 user
28
+
29
+ # Switch to the "user" user
30
+ USER user
31
+
32
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
33
+
34
+ RUN [ "python", "-c", "import nltk; nltk.download('punkt')" ]
35
+
36
+ # Set home to the user's home directory
37
+ ENV HOME=/home/user \
38
+ PATH=/home/user/.local/bin:$PATH
39
+
40
+ # Set the working directory to the user's home directory
41
+ WORKDIR $HOME/app
42
+
43
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
44
+ COPY --chown=user . $HOME/app
45
+
46
+ COPY . .
47
+
48
+ CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]