Neurolingua
commited on
Commit
•
2c57aff
1
Parent(s):
754b631
Update Dockerfile
Browse files- Dockerfile +40 -2
Dockerfile
CHANGED
@@ -1,17 +1,55 @@
|
|
1 |
FROM python:3.9
|
2 |
|
|
|
3 |
WORKDIR /code
|
4 |
|
5 |
# Upgrade pip first
|
6 |
RUN pip install --upgrade pip
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
# Copy the requirements file
|
9 |
COPY ./requirements.txt /code/requirements.txt
|
10 |
|
11 |
-
# Install the dependencies
|
12 |
RUN pip install --no-cache-dir -r /code/requirements.txt
|
13 |
|
14 |
# Copy the rest of the application code
|
15 |
COPY . /code
|
16 |
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
FROM python:3.9
|
2 |
|
3 |
+
# Set working directory
|
4 |
WORKDIR /code
|
5 |
|
6 |
# Upgrade pip first
|
7 |
RUN pip install --upgrade pip
|
8 |
|
9 |
+
# Install dependencies
|
10 |
+
RUN apt-get update && apt-get install -y \
|
11 |
+
wget \
|
12 |
+
unzip \
|
13 |
+
xvfb \
|
14 |
+
libxi6 \
|
15 |
+
libgconf-2-4 \
|
16 |
+
libnss3 \
|
17 |
+
libxss1 \
|
18 |
+
libappindicator1 \
|
19 |
+
libindicator7 \
|
20 |
+
fonts-liberation \
|
21 |
+
libasound2 \
|
22 |
+
libatk-bridge2.0-0 \
|
23 |
+
libgtk-3-0 \
|
24 |
+
libx11-xcb1 \
|
25 |
+
libxcomposite1 \
|
26 |
+
libxcursor1 \
|
27 |
+
libxdamage1 \
|
28 |
+
libxi6 \
|
29 |
+
libxtst6 \
|
30 |
+
xdg-utils \
|
31 |
+
google-chrome-stable
|
32 |
+
|
33 |
+
# Download and install ChromeDriver
|
34 |
+
RUN CHROME_VERSION=$(google-chrome --version | grep -oP '\d+\.\d+\.\d+') \
|
35 |
+
&& wget -O /tmp/chromedriver.zip https://chromedriver.storage.googleapis.com/${CHROME_VERSION}/chromedriver_linux64.zip \
|
36 |
+
&& unzip /tmp/chromedriver.zip -d /usr/local/bin/ \
|
37 |
+
&& rm /tmp/chromedriver.zip
|
38 |
+
|
39 |
# Copy the requirements file
|
40 |
COPY ./requirements.txt /code/requirements.txt
|
41 |
|
42 |
+
# Install the Python dependencies
|
43 |
RUN pip install --no-cache-dir -r /code/requirements.txt
|
44 |
|
45 |
# Copy the rest of the application code
|
46 |
COPY . /code
|
47 |
|
48 |
+
# Create a custom cache directory with correct permissions
|
49 |
+
RUN mkdir -p /code/selenium_cache && chmod -R 755 /code/selenium_cache
|
50 |
+
|
51 |
+
# Set the environment variable for the custom cache directory
|
52 |
+
ENV XDG_CACHE_HOME /code/selenium_cache
|
53 |
+
|
54 |
+
# Command to run the application
|
55 |
+
CMD ["python", "app.py"]
|