Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +10 -7
Dockerfile
CHANGED
|
@@ -2,19 +2,21 @@ FROM python:3.9-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# Create
|
| 6 |
RUN mkdir -p /tmp/huggingface/hub \
|
|
|
|
| 7 |
&& mkdir -p /app/.streamlit \
|
| 8 |
&& chmod -R 777 /tmp/huggingface \
|
| 9 |
-
&& chmod -R 777 /
|
|
|
|
| 10 |
|
| 11 |
-
# Set environment variables
|
| 12 |
ENV TRANSFORMERS_CACHE=/tmp/huggingface
|
| 13 |
ENV HF_HOME=/tmp/huggingface
|
| 14 |
ENV XDG_CACHE_HOME=/app/.streamlit
|
| 15 |
ENV HOME=/app
|
| 16 |
|
| 17 |
-
# Install
|
| 18 |
RUN apt-get update && apt-get install -y \
|
| 19 |
build-essential \
|
| 20 |
ffmpeg \
|
|
@@ -23,18 +25,19 @@ RUN apt-get update && apt-get install -y \
|
|
| 23 |
git \
|
| 24 |
&& rm -rf /var/lib/apt/lists/*
|
| 25 |
|
| 26 |
-
# Install Python
|
| 27 |
COPY requirements.txt ./
|
| 28 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 29 |
|
| 30 |
-
# Copy
|
| 31 |
COPY app.py ./
|
| 32 |
COPY utils/ ./utils/
|
| 33 |
COPY models/ ./models/
|
| 34 |
COPY .streamlit/ .streamlit/
|
| 35 |
|
| 36 |
-
#
|
| 37 |
RUN chmod -R 777 /tmp/huggingface \
|
|
|
|
| 38 |
&& chmod -R 777 /app/.streamlit
|
| 39 |
|
| 40 |
EXPOSE 8501
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Create cache and config directories with permissions
|
| 6 |
RUN mkdir -p /tmp/huggingface/hub \
|
| 7 |
+
&& mkdir -p /tmp/pretrained_models \
|
| 8 |
&& mkdir -p /app/.streamlit \
|
| 9 |
&& chmod -R 777 /tmp/huggingface \
|
| 10 |
+
&& chmod -R 777 /tmp/pretrained_models \
|
| 11 |
+
&& chmod -R 777 /app/.
|
| 12 |
|
| 13 |
+
# Set environment variables
|
| 14 |
ENV TRANSFORMERS_CACHE=/tmp/huggingface
|
| 15 |
ENV HF_HOME=/tmp/huggingface
|
| 16 |
ENV XDG_CACHE_HOME=/app/.streamlit
|
| 17 |
ENV HOME=/app
|
| 18 |
|
| 19 |
+
# Install dependencies
|
| 20 |
RUN apt-get update && apt-get install -y \
|
| 21 |
build-essential \
|
| 22 |
ffmpeg \
|
|
|
|
| 25 |
git \
|
| 26 |
&& rm -rf /var/lib/apt/lists/*
|
| 27 |
|
| 28 |
+
# Install Python packages
|
| 29 |
COPY requirements.txt ./
|
| 30 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 31 |
|
| 32 |
+
# Copy app files
|
| 33 |
COPY app.py ./
|
| 34 |
COPY utils/ ./utils/
|
| 35 |
COPY models/ ./models/
|
| 36 |
COPY .streamlit/ .streamlit/
|
| 37 |
|
| 38 |
+
# Fix permissions after copying files
|
| 39 |
RUN chmod -R 777 /tmp/huggingface \
|
| 40 |
+
&& chmod -R 777 /tmp/pretrained_models \
|
| 41 |
&& chmod -R 777 /app/.streamlit
|
| 42 |
|
| 43 |
EXPOSE 8501
|