Spaces:
Runtime error
Runtime error
Commit
·
ff55134
1
Parent(s):
a19c976
afA
Browse files- Dockerfile +4 -10
Dockerfile
CHANGED
|
@@ -31,24 +31,18 @@ RUN CHROMEDRIVER_VERSION=$(curl -sS chromedriver.storage.googleapis.com/LATEST_R
|
|
| 31 |
&& wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip \
|
| 32 |
&& unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/
|
| 33 |
|
|
|
|
|
|
|
|
|
|
| 34 |
# Install Python dependencies
|
| 35 |
-
COPY requirements.txt /tmp/requirements.txt
|
| 36 |
RUN pip install --no-cache-dir --upgrade pip \
|
| 37 |
&& pip install --no-cache-dir -r /tmp/requirements.txt
|
| 38 |
|
| 39 |
-
# Create a user and set permissions
|
| 40 |
-
RUN useradd -m -u 1000 user
|
| 41 |
-
RUN chown -R user:user /code
|
| 42 |
-
|
| 43 |
# Copy application code
|
| 44 |
COPY --chown=user . /code
|
| 45 |
-
|
| 46 |
WORKDIR /code
|
| 47 |
|
| 48 |
-
# Switch to the new user
|
| 49 |
-
USER user
|
| 50 |
-
ENV PATH="/home/user/.local/bin:$PATH"
|
| 51 |
-
|
| 52 |
# Use secrets during build
|
| 53 |
RUN --mount=type=secret,id=HOST,required=true \
|
| 54 |
--mount=type=secret,id=DJANGO_SECRET,required=true \
|
|
|
|
| 31 |
&& wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip \
|
| 32 |
&& unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/
|
| 33 |
|
| 34 |
+
RUN useradd -m -u 1000 user
|
| 35 |
+
USER user
|
| 36 |
+
|
| 37 |
# Install Python dependencies
|
| 38 |
+
COPY --chown=user requirements.txt /tmp/requirements.txt
|
| 39 |
RUN pip install --no-cache-dir --upgrade pip \
|
| 40 |
&& pip install --no-cache-dir -r /tmp/requirements.txt
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
# Copy application code
|
| 43 |
COPY --chown=user . /code
|
|
|
|
| 44 |
WORKDIR /code
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
# Use secrets during build
|
| 47 |
RUN --mount=type=secret,id=HOST,required=true \
|
| 48 |
--mount=type=secret,id=DJANGO_SECRET,required=true \
|