amirjamali commited on
Commit
cca2050
·
unverified ·
1 Parent(s): aca25cc

Add Streamlit configuration directly in Dockerfile; set server parameters, browser settings, runner options, and theme colors

Browse files
Files changed (2) hide show
  1. .streamlit/temp-config.toml +20 -0
  2. Dockerfile +23 -5
.streamlit/temp-config.toml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [server]
2
+ port = 8501
3
+ address = "0.0.0.0"
4
+ headless = true
5
+ enableCORS = false
6
+ maxUploadSize = 200
7
+ enableXsrfProtection = false
8
+
9
+ [browser]
10
+ gatherUsageStats = false
11
+
12
+ [runner]
13
+ fastReruns = true
14
+
15
+ [theme]
16
+ primaryColor = "#2196F3"
17
+ backgroundColor = "#FFFFFF"
18
+ secondaryBackgroundColor = "#F0F2F6"
19
+ textColor = "#262730"
20
+ font = "sans serif"
Dockerfile CHANGED
@@ -42,11 +42,29 @@ RUN pip install --no-cache-dir --upgrade pip && \
42
  # Copy source code
43
  COPY src/ ./src/
44
 
45
- # Copy the Streamlit directory with configuration
46
- COPY .streamlit/ ./.streamlit/
47
-
48
- # Set proper permissions on the Streamlit configuration
49
- RUN chmod -R 755 ./.streamlit && \
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  chmod 644 ./.streamlit/config.toml
51
 
52
  # Expose port
 
42
  # Copy source code
43
  COPY src/ ./src/
44
 
45
+ # Create Streamlit configuration directly in the container
46
+ RUN mkdir -p .streamlit && \
47
+ echo '[server]' > .streamlit/config.toml && \
48
+ echo 'port = 8501' >> .streamlit/config.toml && \
49
+ echo 'address = "0.0.0.0"' >> .streamlit/config.toml && \
50
+ echo 'headless = true' >> .streamlit/config.toml && \
51
+ echo 'enableCORS = false' >> .streamlit/config.toml && \
52
+ echo 'maxUploadSize = 200' >> .streamlit/config.toml && \
53
+ echo 'enableXsrfProtection = false' >> .streamlit/config.toml && \
54
+ echo '' >> .streamlit/config.toml && \
55
+ echo '[browser]' >> .streamlit/config.toml && \
56
+ echo 'gatherUsageStats = false' >> .streamlit/config.toml && \
57
+ echo '' >> .streamlit/config.toml && \
58
+ echo '[runner]' >> .streamlit/config.toml && \
59
+ echo 'fastReruns = true' >> .streamlit/config.toml && \
60
+ echo '' >> .streamlit/config.toml && \
61
+ echo '[theme]' >> .streamlit/config.toml && \
62
+ echo 'primaryColor = "#2196F3"' >> .streamlit/config.toml && \
63
+ echo 'backgroundColor = "#FFFFFF"' >> .streamlit/config.toml && \
64
+ echo 'secondaryBackgroundColor = "#F0F2F6"' >> .streamlit/config.toml && \
65
+ echo 'textColor = "#262730"' >> .streamlit/config.toml && \
66
+ echo 'font = "sans serif"' >> .streamlit/config.toml && \
67
+ chmod -R 755 ./.streamlit && \
68
  chmod 644 ./.streamlit/config.toml
69
 
70
  # Expose port