Neurolingua commited on
Commit
cc3fbd0
·
verified ·
1 Parent(s): c506f05

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -23
Dockerfile CHANGED
@@ -15,42 +15,28 @@ RUN apt-get update && apt-get install -y \
15
  libappindicator1 \
16
  libgbm-dev \
17
  libgtk-3-0 \
18
- chromium \
 
 
 
 
 
 
19
  && rm -rf /var/lib/apt/lists/*
20
 
21
- # Install Google Chrome
22
- RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
23
- RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
24
- RUN apt-get -y update
25
- RUN apt-get install -y google-chrome-stable
26
-
27
- # Install ChromeDriver
28
- RUN apt-get install -yqq unzip
29
- RUN wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip
30
- RUN unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/
31
-
32
- # Set display port to avoid crash
33
- ENV DISPLAY=:99
34
-
35
- # Install Selenium
36
- RUN pip install selenium==3.8.0
37
-
38
  WORKDIR /code
39
  RUN mkdir -p /code/uploads && chmod 755 /code/uploads
40
 
41
  # Copy and install Python dependencies
42
  COPY ./requirements.txt /code/requirements.txt
43
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
44
- COPY . /code
45
 
46
  # Add and use a non-root user
47
  RUN useradd -ms /bin/sh myuser
48
  RUN chown -R myuser:myuser /code
49
  USER myuser
50
 
51
- # Set environment variables for Chrome
52
- ENV CHROME_BIN=/usr/bin/chromium
53
- ENV CHROME_DRIVER=/usr/local/bin/chromedriver
54
 
55
  # Default command to run the application
56
- CMD ["python", "app.py"]
 
15
  libappindicator1 \
16
  libgbm-dev \
17
  libgtk-3-0 \
18
+ # Install the dependencies for Scrapy
19
+ gcc \
20
+ libffi-dev \
21
+ libxml2-dev \
22
+ libxslt1-dev \
23
+ libjpeg-dev \
24
+ zlib1g-dev \
25
  && rm -rf /var/lib/apt/lists/*
26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  WORKDIR /code
28
  RUN mkdir -p /code/uploads && chmod 755 /code/uploads
29
 
30
  # Copy and install Python dependencies
31
  COPY ./requirements.txt /code/requirements.txt
32
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
33
 
34
  # Add and use a non-root user
35
  RUN useradd -ms /bin/sh myuser
36
  RUN chown -R myuser:myuser /code
37
  USER myuser
38
 
39
+ COPY . /code
 
 
40
 
41
  # Default command to run the application
42
+ CMD ["python", "app.py"]