Spaces:
Running
Running
Create dockerfile for cudnn support
Browse files- Dockerfile +52 -0
Dockerfile
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM nvidia/cuda:12.3.2-cudnn9-devel-ubuntu22.04
|
2 |
+
|
3 |
+
# Set environment variables
|
4 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
5 |
+
ENV PYTHONUNBUFFERED=1
|
6 |
+
ENV PYTHONDONTWRITEBYTECODE=1
|
7 |
+
|
8 |
+
# Install system dependencies
|
9 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
10 |
+
git \
|
11 |
+
wget \
|
12 |
+
curl \
|
13 |
+
ca-certificates \
|
14 |
+
python3 \
|
15 |
+
python3-pip \
|
16 |
+
python3-dev \
|
17 |
+
ffmpeg \
|
18 |
+
libsm6 \
|
19 |
+
libxext6 \
|
20 |
+
libgl1-mesa-glx \
|
21 |
+
&& apt-get clean \
|
22 |
+
&& rm -rf /var/lib/apt/lists/*
|
23 |
+
|
24 |
+
# Set working directory
|
25 |
+
WORKDIR /app
|
26 |
+
|
27 |
+
# Copy requirements.txt
|
28 |
+
COPY requirements.txt /app/
|
29 |
+
|
30 |
+
# Install Python dependencies
|
31 |
+
RUN pip3 install --no-cache-dir --upgrade pip setuptools wheel
|
32 |
+
RUN pip3 install --no-cache-dir -r requirements.txt
|
33 |
+
|
34 |
+
# Install OpenCV with CUDA support
|
35 |
+
RUN pip3 install --no-cache-dir opencv-python-headless opencv-contrib-python-headless
|
36 |
+
|
37 |
+
# Copy application code
|
38 |
+
COPY . /app/
|
39 |
+
|
40 |
+
# Ensure script files have the right permissions
|
41 |
+
RUN chmod +x /app/run_morphing.py
|
42 |
+
RUN chmod +x /app/FILM.py
|
43 |
+
|
44 |
+
# Set environment variables for CUDA
|
45 |
+
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH}
|
46 |
+
ENV PATH=/usr/local/cuda/bin:${PATH}
|
47 |
+
|
48 |
+
# Expose port for Streamlit
|
49 |
+
EXPOSE 8501
|
50 |
+
|
51 |
+
# Command to run the application
|
52 |
+
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|