Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +17 -14
Dockerfile
CHANGED
@@ -6,32 +6,35 @@ ENV PYTHONUNBUFFERED=1 \
|
|
6 |
PORT=7860 \
|
7 |
PYTHONPATH=/app \
|
8 |
HOME=/home/chrome \
|
9 |
-
CHROME_BIN=/usr/bin/google-chrome
|
10 |
|
11 |
-
#
|
12 |
-
RUN mkdir -p /home/chrome && \
|
13 |
-
groupadd -r chrome && \
|
14 |
-
useradd -r -g chrome -G audio,video chrome && \
|
15 |
-
mkdir -p /home/chrome/Downloads && \
|
16 |
-
chown -R chrome:chrome /home/chrome
|
17 |
-
|
18 |
-
# Set the working directory
|
19 |
-
WORKDIR /app
|
20 |
-
|
21 |
-
# Install system dependencies including Chrome
|
22 |
RUN apt-get update && apt-get install -y \
|
23 |
build-essential \
|
24 |
wget \
|
25 |
gnupg \
|
26 |
unzip \
|
27 |
xvfb \
|
|
|
28 |
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
|
29 |
&& echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list \
|
30 |
&& apt-get update \
|
31 |
&& apt-get install -y google-chrome-stable \
|
32 |
-
&& chown -R chrome:chrome /usr/bin/google-chrome \
|
33 |
&& rm -rf /var/lib/apt/lists/*
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
# Copy requirements file
|
36 |
COPY requirements.txt .
|
37 |
|
@@ -42,7 +45,7 @@ RUN pip install --no-cache-dir -r requirements.txt \
|
|
42 |
# Copy the current directory contents into the container
|
43 |
COPY . /app
|
44 |
|
45 |
-
#
|
46 |
RUN chown -R chrome:chrome /app
|
47 |
|
48 |
# Switch to chrome user
|
|
|
6 |
PORT=7860 \
|
7 |
PYTHONPATH=/app \
|
8 |
HOME=/home/chrome \
|
9 |
+
CHROME_BIN=/usr/bin/google-chrome-stable
|
10 |
|
11 |
+
# Install system dependencies including Chrome and other utilities
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
RUN apt-get update && apt-get install -y \
|
13 |
build-essential \
|
14 |
wget \
|
15 |
gnupg \
|
16 |
unzip \
|
17 |
xvfb \
|
18 |
+
curl \
|
19 |
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
|
20 |
&& echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list \
|
21 |
&& apt-get update \
|
22 |
&& apt-get install -y google-chrome-stable \
|
|
|
23 |
&& rm -rf /var/lib/apt/lists/*
|
24 |
|
25 |
+
# Create chrome user and set appropriate permissions
|
26 |
+
RUN groupadd -r chrome && \
|
27 |
+
useradd -r -g chrome -G audio,video chrome && \
|
28 |
+
mkdir -p /home/chrome/Downloads && \
|
29 |
+
chown -R chrome:chrome /home/chrome
|
30 |
+
|
31 |
+
# Ensure the .cache directory exists and has proper permissions
|
32 |
+
RUN mkdir -p /home/chrome/.cache && \
|
33 |
+
chown -R chrome:chrome /home/chrome/.cache
|
34 |
+
|
35 |
+
# Set the working directory
|
36 |
+
WORKDIR /app
|
37 |
+
|
38 |
# Copy requirements file
|
39 |
COPY requirements.txt .
|
40 |
|
|
|
45 |
# Copy the current directory contents into the container
|
46 |
COPY . /app
|
47 |
|
48 |
+
# Ensure permissions are correct for the app directory
|
49 |
RUN chown -R chrome:chrome /app
|
50 |
|
51 |
# Switch to chrome user
|