Lokiiparihar commited on
Commit
ab0cd9b
·
verified ·
1 Parent(s): 314784c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -5
Dockerfile CHANGED
@@ -1,21 +1,28 @@
1
  # Base image
2
  FROM python:3.10-slim
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
  # Copy requirements
8
  COPY requirements.txt .
9
 
10
- # Install dependencies
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
- # Copy app files
14
  COPY app.py .
15
  COPY superkart_sales_prediction_model_v1_0.joblib .
16
 
 
 
 
 
 
 
 
 
 
17
  # Expose port
18
  EXPOSE 7860
19
 
20
- # Run Streamlit
21
- CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
 
1
  # Base image
2
  FROM python:3.10-slim
3
 
 
4
  WORKDIR /app
5
 
6
  # Copy requirements
7
  COPY requirements.txt .
8
 
 
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
11
+ # Copy app and model
12
  COPY app.py .
13
  COPY superkart_sales_prediction_model_v1_0.joblib .
14
 
15
+ # Create a writable streamlit config folder
16
+ RUN mkdir -p /app/.streamlit
17
+
18
+ # Add a minimal config.toml to avoid telemetry write errors
19
+ RUN echo "\
20
+ [general]\n\
21
+ email = \"\"\n\
22
+ " > /app/.streamlit/config.toml
23
+
24
  # Expose port
25
  EXPOSE 7860
26
 
27
+ # Run streamlit using custom config path
28
+ CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--global.dataFrameSerialization=legacy", "--browser.gatherUsageStats=false"]