AitBAD commited on
Commit
6d72288
·
verified ·
1 Parent(s): f8aff6d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -3
Dockerfile CHANGED
@@ -20,9 +20,26 @@ WORKDIR /app
20
  # Copy the rest of your application code (including app.py, tessdata/, etc.)
21
  COPY . .
22
 
23
- # Expose the port Streamlit runs on (default is 8501)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  EXPOSE 7860
25
 
26
  # Define the command to run your Streamlit app
27
- # Use --server.address 0.0.0.0 to allow external connections
28
- CMD ["streamlit", "run", "app.py", "--server.address", "0.0.0.0"]
 
 
 
 
20
  # Copy the rest of your application code (including app.py, tessdata/, etc.)
21
  COPY . .
22
 
23
+ # Create Streamlit config to fix 403 error
24
+ RUN mkdir -p ~/.streamlit && \
25
+ echo "[server]\n\
26
+ headless = true\n\
27
+ enableCORS = false\n\
28
+ enableXsrfProtection = false\n\
29
+ maxUploadSize = 200\n\
30
+ port = 7860\n\
31
+ address = \"0.0.0.0\"\n\
32
+ \n\
33
+ [browser]\n\
34
+ gatherUsageStats = false\n\
35
+ " > ~/.streamlit/config.toml
36
+
37
+ # Expose the port for Hugging Face Spaces (must be 7860)
38
  EXPOSE 7860
39
 
40
  # Define the command to run your Streamlit app
41
+ CMD ["streamlit", "run", "app.py", \
42
+ "--server.port=7860", \
43
+ "--server.address=0.0.0.0", \
44
+ "--server.enableCORS=false", \
45
+ "--server.enableXsrfProtection=false"]