Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +14 -4
Dockerfile
CHANGED
@@ -4,10 +4,20 @@ RUN apt-get update && apt-get install -y build-essential curl git && rm -rf /var
|
|
4 |
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
#
|
8 |
-
|
9 |
|
10 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
RUN pip install --upgrade pip && pip install --user -r requirements.txt
|
12 |
|
13 |
-
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
|
|
4 |
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# Create non-root user
|
8 |
+
RUN useradd -m -u 1000 user
|
9 |
|
10 |
+
# Create a directory for the GitHub repo and ensure it has the correct permissions
|
11 |
+
RUN mkdir /app/github_repo && chown -R user:user /app/github_repo
|
12 |
+
|
13 |
+
# Switch to the non-root user
|
14 |
+
USER user
|
15 |
+
|
16 |
+
# Copy application files as the non-root user to avoid permission issues
|
17 |
+
COPY --chown=user:user . /app
|
18 |
+
|
19 |
+
# Install dependencies, ensuring the streamlit executable is in PATH
|
20 |
+
# Ensure the requirements.txt is present and correctly referenced here
|
21 |
RUN pip install --upgrade pip && pip install --user -r requirements.txt
|
22 |
|
23 |
+
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|