Kikulika commited on
Commit
7f37b2d
·
verified ·
1 Parent(s): 5142fc1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -4
Dockerfile CHANGED
@@ -1,10 +1,21 @@
1
  FROM python:3.9-slim
2
 
3
- # Create directories without changing permissions
4
- RUN mkdir -p /app/data
5
-
6
  WORKDIR /app
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  # Copy requirements first (for better caching)
9
  COPY requirements.txt .
10
  RUN pip install --no-cache-dir -r requirements.txt
@@ -13,4 +24,4 @@ RUN pip install --no-cache-dir -r requirements.txt
13
  COPY . .
14
 
15
  # Run the application
16
- CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
1
  FROM python:3.9-slim
2
 
3
+ # Create app directory
 
 
4
  WORKDIR /app
5
 
6
+ # Create data directory in /app instead of at root
7
+ RUN mkdir -p /app/data && chmod 777 /app/data
8
+
9
+ # Create temp directory for Streamlit to use instead of trying to write to /.streamlit
10
+ ENV STREAMLIT_HOME_PATH=/app/.streamlit
11
+ RUN mkdir -p $STREAMLIT_HOME_PATH && chmod 777 $STREAMLIT_HOME_PATH
12
+
13
+ # Disable Streamlit telemetry to prevent it from trying to write to /.streamlit
14
+ ENV STREAMLIT_ANALYTICS_ENABLED=false
15
+ ENV STREAMLIT_METRICS_ENABLED=false
16
+ ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=0
17
+ ENV STREAMLIT_SERVER_HEADLESS=true
18
+
19
  # Copy requirements first (for better caching)
20
  COPY requirements.txt .
21
  RUN pip install --no-cache-dir -r requirements.txt
 
24
  COPY . .
25
 
26
  # Run the application
27
+ CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]