Neurolingua commited on
Commit
f618b3b
1 Parent(s): 09c50ed

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -2
Dockerfile CHANGED
@@ -1,14 +1,38 @@
1
  FROM python:3.9-slim
2
- RUN pip install --no-cache-dir --upgrade pip
3
 
 
4
  RUN apt-get update && apt-get install -y \
5
  libgl1-mesa-glx \
6
  libglib2.0-0 \
 
 
 
 
 
 
 
 
 
 
7
  && rm -rf /var/lib/apt/lists/*
8
-
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  WORKDIR /code
10
  RUN mkdir -p /code/uploads && chmod 755 /code/uploads
11
 
 
12
  COPY ./requirements.txt /code/requirements.txt
13
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
14
  COPY . /code
@@ -18,4 +42,5 @@ RUN useradd -ms /bin/sh myuser
18
  RUN chown -R myuser:myuser /code
19
  USER myuser
20
 
 
21
  CMD ["python", "app.py"]
 
1
  FROM python:3.9-slim
 
2
 
3
+ # Install necessary system dependencies
4
  RUN apt-get update && apt-get install -y \
5
  libgl1-mesa-glx \
6
  libglib2.0-0 \
7
+ wget \
8
+ unzip \
9
+ curl \
10
+ ca-certificates \
11
+ fonts-liberation \
12
+ libnss3 \
13
+ libxss1 \
14
+ libappindicator1 \
15
+ libgbm-dev \
16
+ libgtk-3-0 \
17
  && rm -rf /var/lib/apt/lists/*
18
+
19
+ # Install Chrome
20
+ RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
21
+ && echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
22
+ && apt-get update \
23
+ && apt-get install -y google-chrome-stable \
24
+ && rm -rf /var/lib/apt/lists/*
25
+
26
+ # Install ChromeDriver
27
+ RUN CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE` \
28
+ && wget -O /tmp/chromedriver.zip "https://chromedriver.storage.googleapis.com/${CHROME_DRIVER_VERSION}/chromedriver_linux64.zip" \
29
+ && unzip /tmp/chromedriver.zip -d /usr/local/bin/ \
30
+ && rm /tmp/chromedriver.zip
31
+
32
  WORKDIR /code
33
  RUN mkdir -p /code/uploads && chmod 755 /code/uploads
34
 
35
+ # Copy and install Python dependencies
36
  COPY ./requirements.txt /code/requirements.txt
37
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
38
  COPY . /code
 
42
  RUN chown -R myuser:myuser /code
43
  USER myuser
44
 
45
+ # Default command to run the application
46
  CMD ["python", "app.py"]