Luigi commited on
Commit
3f170f0
·
verified ·
1 Parent(s): 22a7aa9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -7
Dockerfile CHANGED
@@ -14,6 +14,7 @@ RUN apt-get update && apt-get install -y \
14
 
15
  # === CRITICAL FIX ===
16
  # Set Streamlit to use temporary directories for ALL storage
 
17
  ENV STREAMLIT_GLOBAL_DEVELOPMENT_MODE=false
18
  ENV STREAMLIT_GLOBAL_DATA_PATH=/tmp
19
  ENV STREAMLIT_CONFIG_DIR=/tmp/.streamlit
@@ -23,12 +24,9 @@ ENV HF_HOME=/tmp/huggingface
23
  RUN mkdir -p /tmp/.streamlit /tmp/huggingface && \
24
  chmod -R 777 /tmp
25
 
26
- # Copy files
27
- COPY requirements.txt ./
28
- COPY src/ ./src/
29
-
30
- # Create config file directly in Dockerfile
31
- RUN echo $'[global]\n\
32
  dataSavePath = "/tmp"\n\
33
  \n\
34
  [browser]\n\
@@ -38,6 +36,10 @@ gatherUsageStats = false\n\
38
  enableCORS = false\n\
39
  enableXsrfProtection = false' > /tmp/.streamlit/config.toml
40
 
 
 
 
 
41
  # Install Python dependencies
42
  RUN pip3 install --no-cache-dir -r requirements.txt
43
 
@@ -46,6 +48,5 @@ EXPOSE 8501
46
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
47
 
48
  ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", \
49
- "--global.dataPath=/tmp", \
50
  "--server.port=8501", \
51
  "--server.address=0.0.0.0"]
 
14
 
15
  # === CRITICAL FIX ===
16
  # Set Streamlit to use temporary directories for ALL storage
17
+ ENV HOME=/tmp
18
  ENV STREAMLIT_GLOBAL_DEVELOPMENT_MODE=false
19
  ENV STREAMLIT_GLOBAL_DATA_PATH=/tmp
20
  ENV STREAMLIT_CONFIG_DIR=/tmp/.streamlit
 
24
  RUN mkdir -p /tmp/.streamlit /tmp/huggingface && \
25
  chmod -R 777 /tmp
26
 
27
+ # Create config file with proper settings
28
+ RUN mkdir -p /tmp/.streamlit && \
29
+ echo $'[global]\n\
 
 
 
30
  dataSavePath = "/tmp"\n\
31
  \n\
32
  [browser]\n\
 
36
  enableCORS = false\n\
37
  enableXsrfProtection = false' > /tmp/.streamlit/config.toml
38
 
39
+ # Copy files
40
+ COPY requirements.txt ./
41
+ COPY src/ ./src/
42
+
43
  # Install Python dependencies
44
  RUN pip3 install --no-cache-dir -r requirements.txt
45
 
 
48
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
49
 
50
  ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", \
 
51
  "--server.port=8501", \
52
  "--server.address=0.0.0.0"]