Spaces:
Runtime error
Runtime error
Tried to fix Dockerfile - Docker secrets not provided
Browse files- Dockerfile +15 -9
Dockerfile
CHANGED
|
@@ -7,25 +7,31 @@ ENV PYTHONFAULTHANDLER=1 \
|
|
| 7 |
POETRY_VERSION=1.5.1 \
|
| 8 |
PIP_NO_CACHE_DIR=1
|
| 9 |
|
| 10 |
-
WORKDIR /app
|
| 11 |
-
|
| 12 |
RUN apt-get update && apt-get install -y \
|
| 13 |
build-essential \
|
| 14 |
curl \
|
| 15 |
software-properties-common \
|
| 16 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
-
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
|
|
|
|
| 20 |
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
|
|
|
|
| 23 |
|
| 24 |
-
|
| 25 |
|
| 26 |
-
|
| 27 |
|
| 28 |
-
|
|
|
|
| 29 |
|
| 30 |
ENV PATH="/app/.venv/bin:$PATH"
|
| 31 |
|
|
|
|
| 7 |
POETRY_VERSION=1.5.1 \
|
| 8 |
PIP_NO_CACHE_DIR=1
|
| 9 |
|
|
|
|
|
|
|
| 10 |
RUN apt-get update && apt-get install -y \
|
| 11 |
build-essential \
|
| 12 |
curl \
|
| 13 |
software-properties-common \
|
| 14 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
+
|
| 16 |
+
# Set up a new user named "user" with user ID 1000
|
| 17 |
+
RUN useradd -m -u 1000 user
|
| 18 |
|
| 19 |
+
# Switch to the "user" user
|
| 20 |
+
USER user
|
| 21 |
|
| 22 |
+
# Set home to the user's home directory
|
| 23 |
+
ENV HOME=/home/user \
|
| 24 |
+
PATH=/home/user/.local/bin:$PATH
|
| 25 |
|
| 26 |
+
# Set the working directory to the user's home directory
|
| 27 |
+
WORKDIR $HOME/app
|
| 28 |
|
| 29 |
+
COPY . $HOME/app
|
| 30 |
|
| 31 |
+
RUN python3 -m pip install -r requirements.txt
|
| 32 |
|
| 33 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 34 |
+
COPY --chown=user . $HOME/app
|
| 35 |
|
| 36 |
ENV PATH="/app/.venv/bin:$PATH"
|
| 37 |
|