Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +27 -22
Dockerfile
CHANGED
@@ -1,36 +1,41 @@
|
|
1 |
FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime
|
2 |
|
3 |
-
|
|
|
|
|
4 |
ENV HF_HOME=/app/hf_cache
|
5 |
ENV TRANSFORMERS_CACHE=/app/hf_cache
|
|
|
|
|
6 |
|
7 |
-
#
|
8 |
RUN apt-get update && apt-get install -y \
|
9 |
-
git
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
libxrender1 \
|
14 |
-
libxext6 \
|
15 |
-
&& apt-get clean
|
16 |
-
|
17 |
-
# --- Set working directory ---
|
18 |
WORKDIR /app
|
19 |
|
20 |
-
#
|
21 |
COPY . /app
|
22 |
|
23 |
-
#
|
24 |
-
RUN mkdir -p /app/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
-
#
|
27 |
-
RUN
|
28 |
-
RUN pip install -r requirements.txt
|
29 |
-
RUN pip install av huggingface_hub
|
30 |
-
RUN pip install --no-binary :all: av # Optional: rebuild AV from source
|
31 |
|
32 |
-
#
|
33 |
EXPOSE 7860
|
34 |
|
35 |
-
#
|
36 |
-
CMD ["python", "
|
|
|
1 |
FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime
|
2 |
|
3 |
+
SHELL ["/bin/bash", "-c"]
|
4 |
+
|
5 |
+
# Environment variables for Hugging Face cache
|
6 |
ENV HF_HOME=/app/hf_cache
|
7 |
ENV TRANSFORMERS_CACHE=/app/hf_cache
|
8 |
+
ENV HF_TOKEN=${HF_TOKEN}
|
9 |
+
ENV PATH=/opt/conda/bin:$PATH
|
10 |
|
11 |
+
# Install system dependencies
|
12 |
RUN apt-get update && apt-get install -y \
|
13 |
+
git wget curl unzip ffmpeg libgl1-mesa-glx libglib2.0-0 && \
|
14 |
+
apt-get clean
|
15 |
+
|
16 |
+
# Set up working directory as /app
|
|
|
|
|
|
|
|
|
|
|
17 |
WORKDIR /app
|
18 |
|
19 |
+
# Copy project into /app
|
20 |
COPY . /app
|
21 |
|
22 |
+
# Fix permissions for all subdirectories
|
23 |
+
RUN mkdir -p /app/pretrained /app/hf_cache /.cache/gdown && \
|
24 |
+
chmod -R 777 /app && \
|
25 |
+
chmod -R 777 /.cache && \
|
26 |
+
chmod -R 777 /root
|
27 |
+
|
28 |
+
# Create conda environment and install dependencies
|
29 |
+
COPY requirements.txt /app/requirements.txt
|
30 |
+
RUN conda create -n epic python=3.10 -y && \
|
31 |
+
conda run -n epic pip install --upgrade pip && \
|
32 |
+
conda run -n epic pip install -r /app/requirements.txt
|
33 |
|
34 |
+
# List contents (for debug)
|
35 |
+
RUN ls -la /app
|
|
|
|
|
|
|
36 |
|
37 |
+
# Expose Gradio default port
|
38 |
EXPOSE 7860
|
39 |
|
40 |
+
# Start the Gradio app
|
41 |
+
CMD ["conda", "run", "--no-capture-output", "-n", "epic", "python", "gradio_app.py"]
|