Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +17 -4
Dockerfile
CHANGED
|
@@ -11,16 +11,29 @@ RUN apt-get update && apt-get install -y \
|
|
| 11 |
libglib2.0-0 \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
-
COPY requirements.txt ./
|
| 15 |
COPY src/ ./src/
|
| 16 |
-
COPY best.pt ./src/
|
| 17 |
|
| 18 |
RUN pip3 install --no-cache-dir -r requirements.txt
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
|
|
|
|
|
|
| 22 |
ENV STREAMLIT_CONFIG_DIR=/app/.streamlit
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
EXPOSE 8501
|
| 25 |
|
| 26 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
|
|
|
|
| 11 |
libglib2.0-0 \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
COPY requirements.txt ./requirements.txt
|
| 15 |
COPY src/ ./src/
|
| 16 |
+
COPY best.pt ./src/best.pt
|
| 17 |
|
| 18 |
RUN pip3 install --no-cache-dir -r requirements.txt
|
| 19 |
|
| 20 |
+
# Fix permissions and configs
|
| 21 |
+
ENV HOME=/app
|
| 22 |
+
ENV XDG_CONFIG_HOME=/app/.config
|
| 23 |
+
ENV STREAMLIT_HOME=/app/.streamlit
|
| 24 |
ENV STREAMLIT_CONFIG_DIR=/app/.streamlit
|
| 25 |
|
| 26 |
+
RUN mkdir -p /app/.streamlit && \
|
| 27 |
+
echo "\
|
| 28 |
+
[server]\n\
|
| 29 |
+
headless = true\n\
|
| 30 |
+
enableCORS = false\n\
|
| 31 |
+
port = 8501\n\
|
| 32 |
+
\n\
|
| 33 |
+
[browser]\n\
|
| 34 |
+
gatherUsageStats = false\n\
|
| 35 |
+
" > /app/.streamlit/config.toml
|
| 36 |
+
|
| 37 |
EXPOSE 8501
|
| 38 |
|
| 39 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
|