Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -11
Dockerfile
CHANGED
|
@@ -7,24 +7,26 @@ WORKDIR /app
|
|
| 7 |
# Copy the current directory contents into the container at /app
|
| 8 |
COPY . /app
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
RUN useradd -m -u 1000 user
|
| 14 |
-
|
|
|
|
| 15 |
ENV HOME=/home/user \
|
| 16 |
-
|
| 17 |
|
|
|
|
| 18 |
WORKDIR $HOME/app
|
| 19 |
|
|
|
|
| 20 |
COPY --chown=user . $HOME/app
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
# Install system dependencies
|
| 25 |
-
RUN apt-get update && apt-get install -y \
|
| 26 |
-
git \
|
| 27 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 28 |
|
| 29 |
# Install Python dependencies
|
| 30 |
RUN pip install --no-cache-dir --upgrade pip
|
|
@@ -42,4 +44,4 @@ EXPOSE 8501
|
|
| 42 |
EXPOSE 5000
|
| 43 |
|
| 44 |
# Run data loading, backend, and frontend
|
| 45 |
-
CMD ["sh", "-c", "python load_data.py && python run.py & streamlit run ui/app.py --server.port=8501 --server.address=0.0.0.0"]
|
|
|
|
| 7 |
# Copy the current directory contents into the container at /app
|
| 8 |
COPY . /app
|
| 9 |
|
| 10 |
+
# Install system dependencies
|
| 11 |
+
RUN apt-get update && apt-get install -y \
|
| 12 |
+
git \
|
| 13 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
+
# Create a non-root user and switch to that user
|
|
|
|
| 16 |
RUN useradd -m -u 1000 user
|
| 17 |
+
|
| 18 |
+
# Set the home directory for the user
|
| 19 |
ENV HOME=/home/user \
|
| 20 |
+
PATH=/home/user/.local/bin:$PATH
|
| 21 |
|
| 22 |
+
# Set the working directory for the new user
|
| 23 |
WORKDIR $HOME/app
|
| 24 |
|
| 25 |
+
# Change ownership of the app directory
|
| 26 |
COPY --chown=user . $HOME/app
|
| 27 |
|
| 28 |
+
# Switch to the new user
|
| 29 |
+
USER user
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
# Install Python dependencies
|
| 32 |
RUN pip install --no-cache-dir --upgrade pip
|
|
|
|
| 44 |
EXPOSE 5000
|
| 45 |
|
| 46 |
# Run data loading, backend, and frontend
|
| 47 |
+
CMD ["sh", "-c", "python load_data.py && python run.py & streamlit run ui/app.py --server.port=8501 --server.address=0.0.0.0"]
|