Uzaiir commited on
Commit
8e67d76
·
verified ·
1 Parent(s): 6432395

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -18
Dockerfile CHANGED
@@ -18,30 +18,26 @@
18
  # CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
19
 
20
 
21
- FROM python:3.10-slim
 
22
 
23
- WORKDIR /src
 
24
 
25
- # Copy requirements and install
26
- COPY requirements.txt /src/
27
- RUN pip install --no-cache-dir -r requirements.txt
28
-
29
- # Copy all source code
30
- COPY src/ /src/
31
 
32
- # Create a writable .streamlit config directory
33
- RUN mkdir -p /src/.streamlit
34
 
35
- # Optionally add a config file (to suppress warnings, etc.)
36
- RUN echo "\
37
- [server]\n\
38
- headless = true\n\
39
- port = 8501\n\
40
- enableCORS = false\n\
41
- \n\
42
- " > /src/.streamlit/config.toml
43
 
 
44
  EXPOSE 8501
45
 
 
46
  CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
47
 
 
 
18
  # CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
19
 
20
 
21
+ # Use an official Python image
22
+ FROM python:3.10
23
 
24
+ # Set the working directory
25
+ WORKDIR /app
26
 
27
+ # Copy all files to the container
28
+ COPY . /app
 
 
 
 
29
 
30
+ # Install dependencies
31
+ RUN pip install --no-cache-dir -r requirements.txt
32
 
33
+ # Create the .streamlit config directory and copy config.toml
34
+ RUN mkdir -p /root/.streamlit
35
+ COPY .streamlit/config.toml /root/.streamlit/config.toml
 
 
 
 
 
36
 
37
+ # Expose port 8501 for Streamlit
38
  EXPOSE 8501
39
 
40
+ # Run the Streamlit app
41
  CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
42
 
43
+