gtech13 commited on
Commit
b95f154
·
verified ·
1 Parent(s): fa8cc7d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -6
Dockerfile CHANGED
@@ -4,17 +4,16 @@ FROM python:3.10
4
  RUN useradd -m -u 1000 user
5
  USER user
6
  ENV PATH="/home/user/.local/bin:$PATH"
7
- ENV HOME="/home/user"
8
 
9
  # 2. Set the working directory to that user's safe space
10
- WORKDIR $HOME/app
11
 
12
- # 3. Copy requirements and install them
13
  COPY --chown=user:user requirements.txt .
14
- RUN pip install --no-cache-dir -r requirements.txt
15
 
16
  # 4. Copy your app.py and images into the safe space
17
  COPY --chown=user:user . .
18
 
19
- # 5. Launch Streamlit
20
- CMD ["streamlit", "run", "app.py", "--server.port", "7860", "--server.address", "0.0.0.0"]
 
4
  RUN useradd -m -u 1000 user
5
  USER user
6
  ENV PATH="/home/user/.local/bin:$PATH"
 
7
 
8
  # 2. Set the working directory to that user's safe space
9
+ WORKDIR /home/user/app
10
 
11
+ # 3. Copy requirements and install them securely
12
  COPY --chown=user:user requirements.txt .
13
+ RUN pip install --user --no-cache-dir -r requirements.txt
14
 
15
  # 4. Copy your app.py and images into the safe space
16
  COPY --chown=user:user . .
17
 
18
+ # 5. Launch using the Python Module bypass (The Fix!)
19
+ CMD ["python", "-m", "streamlit", "run", "app.py", "--server.port", "7860", "--server.address", "0.0.0.0"]