Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +8 -24
Dockerfile
CHANGED
|
@@ -4,7 +4,9 @@ WORKDIR /app
|
|
| 4 |
|
| 5 |
# Set HOME to a writable location
|
| 6 |
ENV HOME=/app
|
| 7 |
-
|
|
|
|
|
|
|
| 8 |
|
| 9 |
# Install system dependencies
|
| 10 |
RUN apt-get update && apt-get install -y \
|
|
@@ -22,26 +24,6 @@ RUN apt-get update && apt-get install -y \
|
|
| 22 |
libsqlite3-dev \
|
| 23 |
zlib1g-dev \
|
| 24 |
&& rm -rf /var/lib/apt/lists/*
|
| 25 |
-
# Copy app files
|
| 26 |
-
COPY app.py /app
|
| 27 |
-
COPY requirements.txt /app
|
| 28 |
-
|
| 29 |
-
# Install Python dependencies
|
| 30 |
-
RUN pip install --upgrade pip
|
| 31 |
-
RUN pip install -r requirements.txt
|
| 32 |
-
|
| 33 |
-
# Create writable directories and fix permissions
|
| 34 |
-
RUN mkdir -p /app/.streamlit /app/.torch /tmp/.streamlit && \
|
| 35 |
-
chmod -R 777 /app && \
|
| 36 |
-
chmod -R 777 /tmp
|
| 37 |
-
|
| 38 |
-
# Set environment variables to avoid write permission issues
|
| 39 |
-
ENV TORCH_HOME=/tmp/.torch
|
| 40 |
-
ENV STREAMLIT_HOME=/tmp/.streamlit
|
| 41 |
-
ENV MPLCONFIGDIR=/tmp/mplconfig
|
| 42 |
-
|
| 43 |
-
# Create required writable folders
|
| 44 |
-
RUN mkdir -p /app/.torch /app/.streamlit /app/.config/matplotlib
|
| 45 |
|
| 46 |
# Copy project files
|
| 47 |
COPY requirements.txt ./
|
|
@@ -50,9 +32,11 @@ COPY src/ ./src/
|
|
| 50 |
# Install Python dependencies
|
| 51 |
RUN pip install --upgrade pip && \
|
| 52 |
pip install "numpy<2.0" && \
|
| 53 |
-
pip install -r requirements.txt
|
| 54 |
-
|
| 55 |
-
|
|
|
|
|
|
|
| 56 |
|
| 57 |
EXPOSE 8501
|
| 58 |
|
|
|
|
| 4 |
|
| 5 |
# Set HOME to a writable location
|
| 6 |
ENV HOME=/app
|
| 7 |
+
ENV TORCH_HOME=/tmp/.torch
|
| 8 |
+
ENV STREAMLIT_HOME=/tmp/.streamlit
|
| 9 |
+
ENV MPLCONFIGDIR=/tmp/mplconfig
|
| 10 |
|
| 11 |
# Install system dependencies
|
| 12 |
RUN apt-get update && apt-get install -y \
|
|
|
|
| 24 |
libsqlite3-dev \
|
| 25 |
zlib1g-dev \
|
| 26 |
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
# Copy project files
|
| 29 |
COPY requirements.txt ./
|
|
|
|
| 32 |
# Install Python dependencies
|
| 33 |
RUN pip install --upgrade pip && \
|
| 34 |
pip install "numpy<2.0" && \
|
| 35 |
+
pip install -r requirements.txt
|
| 36 |
+
|
| 37 |
+
# Create writable directories
|
| 38 |
+
RUN mkdir -p /app/.torch /app/.streamlit /app/.config/matplotlib /tmp && \
|
| 39 |
+
chmod -R 777 /app /tmp
|
| 40 |
|
| 41 |
EXPOSE 8501
|
| 42 |
|