Update Dockerfile
Browse files- Dockerfile +8 -6
Dockerfile
CHANGED
|
@@ -11,27 +11,29 @@ RUN apt-get update && apt-get install -y \
|
|
| 11 |
git \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
-
#
|
| 15 |
RUN mkdir -p /app/.streamlit
|
| 16 |
|
| 17 |
-
# Add Streamlit config
|
| 18 |
RUN echo "\
|
| 19 |
[server]\n\
|
| 20 |
headless = true\n\
|
| 21 |
port = 8501\n\
|
| 22 |
enableCORS = false\n\
|
|
|
|
| 23 |
\n\
|
| 24 |
[browser]\n\
|
| 25 |
gatherUsageStats = false\n\
|
| 26 |
" > /app/.streamlit/config.toml
|
| 27 |
|
| 28 |
-
# Copy
|
| 29 |
-
COPY requirements.txt .
|
| 30 |
COPY . .
|
| 31 |
|
| 32 |
-
|
|
|
|
| 33 |
|
| 34 |
-
# Expose port
|
| 35 |
EXPOSE 8501
|
| 36 |
|
| 37 |
# Healthcheck
|
|
|
|
| 11 |
git \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
# Ensure .streamlit dir exists
|
| 15 |
RUN mkdir -p /app/.streamlit
|
| 16 |
|
| 17 |
+
# Add Streamlit config (fix CORS + XSRF)
|
| 18 |
RUN echo "\
|
| 19 |
[server]\n\
|
| 20 |
headless = true\n\
|
| 21 |
port = 8501\n\
|
| 22 |
enableCORS = false\n\
|
| 23 |
+
enableXsrfProtection = false\n\
|
| 24 |
\n\
|
| 25 |
[browser]\n\
|
| 26 |
gatherUsageStats = false\n\
|
| 27 |
" > /app/.streamlit/config.toml
|
| 28 |
|
| 29 |
+
# Copy files
|
| 30 |
+
COPY requirements.txt ./
|
| 31 |
COPY . .
|
| 32 |
|
| 33 |
+
# Install Python dependencies
|
| 34 |
+
RUN pip3 install --no-cache-dir -r requirements.txt
|
| 35 |
|
| 36 |
+
# Expose Streamlit port
|
| 37 |
EXPOSE 8501
|
| 38 |
|
| 39 |
# Healthcheck
|