thewise commited on
Commit
f1e9cd6
·
verified ·
1 Parent(s): e4aa027

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -6
Dockerfile CHANGED
@@ -4,15 +4,19 @@ RUN apt-get update && apt-get install -y build-essential curl git && rm -rf /var
4
 
5
  WORKDIR /app
6
 
7
- # Create non-root user and switch to it
8
- RUN useradd -m -u 1000 user && chown -R user:user /app
 
 
9
  USER user
10
 
11
- # Copy application files and install dependencies
12
  COPY --chown=user:user . /app
13
- RUN pip install --upgrade pip && pip install --user -r requirements.txt
14
 
15
- #EXPOSE 8501
16
- #I commented out EXPOSE 8501, and gave 7860 in CMD, since it works. Funny? The building of Streamlit never stops with 8501!!!
 
 
 
17
 
18
  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
+ # Switch to the non-root user earlier if needed
11
  USER user
12
 
13
+ # Copy application files as the non-root user to avoid permission issues
14
  COPY --chown=user:user . /app
 
15
 
16
+ # Update PATH to ensure local bin is included
17
+ ENV PATH=/home/user/.local/bin:$PATH
18
+
19
+ # Install dependencies, ensuring the streamlit executable is in PATH
20
+ RUN pip install --upgrade pip && pip install --user -r requirements.txt
21
 
22
  ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]