Uzaiir commited on
Commit
d96db27
·
verified ·
1 Parent(s): 1c98f0b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +35 -6
Dockerfile CHANGED
@@ -1,18 +1,47 @@
1
- # Use official Python base image
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  FROM python:3.10-slim
3
 
4
- # Set workdir to /src
5
  WORKDIR /src
6
 
7
- # Copy requirements and install dependencies
8
  COPY requirements.txt /src/
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
11
- # Copy entire src directory contents into container
12
  COPY src/ /src/
13
 
14
- # Expose streamlit port
 
 
 
 
 
 
 
 
 
 
 
15
  EXPOSE 8501
16
 
17
- # Command to run your app (adjust if file named differently)
18
  CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
 
1
+ # # Use official Python base image
2
+ # FROM python:3.10-slim
3
+
4
+ # # Set workdir to /src
5
+ # WORKDIR /src
6
+
7
+ # # Copy requirements and install dependencies
8
+ # COPY requirements.txt /src/
9
+ # RUN pip install --no-cache-dir -r requirements.txt
10
+
11
+ # # Copy entire src directory contents into container
12
+ # COPY src/ /src/
13
+
14
+ # # Expose streamlit port
15
+ # EXPOSE 8501
16
+
17
+ # # Command to run your app (adjust if file named differently)
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
+