MBG0903 commited on
Commit
743f440
·
verified ·
1 Parent(s): ba32d34

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -8
Dockerfile CHANGED
@@ -1,22 +1,21 @@
1
  FROM python:3.9
2
 
3
- # Set working directory
4
  WORKDIR /app
5
 
6
- # Copy requirements.txt from root
7
  COPY requirements.txt /app/requirements.txt
8
  RUN pip install --no-cache-dir -r requirements.txt
9
 
10
- # Make a writable home so Streamlit can store machine_id etc.
11
  ENV HOME=/tmp
12
  RUN mkdir -p /tmp/.streamlit && chmod -R 777 /tmp/.streamlit
13
 
14
- # Copy everything inside src folder
15
- COPY src /app
16
 
17
  # Expose Streamlit port
18
  EXPOSE 8501
19
 
20
- # Run Streamlit (note: app file is app.py inside /app now)
21
- CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
22
-
 
1
  FROM python:3.9
2
 
3
+ # Workdir inside the container
4
  WORKDIR /app
5
 
6
+ # Install deps first (better cache)
7
  COPY requirements.txt /app/requirements.txt
8
  RUN pip install --no-cache-dir -r requirements.txt
9
 
10
+ # Streamlit needs a writable home (for machine_id, etc.)
11
  ENV HOME=/tmp
12
  RUN mkdir -p /tmp/.streamlit && chmod -R 777 /tmp/.streamlit
13
 
14
+ # Copy the entire repo (so /app now contains /src and any root files)
15
+ COPY . /app
16
 
17
  # Expose Streamlit port
18
  EXPOSE 8501
19
 
20
+ # Run the app from src/app.py
21
+ CMD ["streamlit", "run", "src/app.py", "--server.port=8501", "--server.address=0.0.0.0"]