Spaces:
Running
Running
oceansweep
commited on
Delete Dockerfile
Browse files- Dockerfile +0 -85
Dockerfile
DELETED
@@ -1,85 +0,0 @@
|
|
1 |
-
# Use Nvidia CUDA runtime as the base image
|
2 |
-
FROM nvidia/cuda:12.6.1-cudnn-runtime-ubuntu24.04
|
3 |
-
|
4 |
-
# Set build arguments for repository configuration
|
5 |
-
ARG REPO_URL=https://github.com/rmusser01/tldw.git
|
6 |
-
ARG BRANCH=main
|
7 |
-
ARG GPU_SUPPORT=cpu
|
8 |
-
|
9 |
-
# Install system dependencies
|
10 |
-
RUN apt-get update && apt-get install -y \
|
11 |
-
ffmpeg \
|
12 |
-
libsqlite3-dev \
|
13 |
-
build-essential \
|
14 |
-
git \
|
15 |
-
python3 \
|
16 |
-
python-is-python3 \
|
17 |
-
python3-pyaudio \
|
18 |
-
portaudio19-dev \
|
19 |
-
python3-pip \
|
20 |
-
python3-venv \
|
21 |
-
libpq-dev \
|
22 |
-
python3-dev \
|
23 |
-
&& rm -rf /var/lib/apt/lists/*
|
24 |
-
|
25 |
-
# Create a new user named "user9" with user ID 1009
|
26 |
-
RUN useradd -m -u 1009 user9
|
27 |
-
|
28 |
-
# Set environment variables for the user's home directory and PATH
|
29 |
-
ENV HOME=/home/user9 \
|
30 |
-
PATH=/home/user9/.local/bin:$PATH
|
31 |
-
|
32 |
-
# Create the app directory and set it as the working directory
|
33 |
-
RUN mkdir -p /home/user9/app
|
34 |
-
WORKDIR /home/user9/app
|
35 |
-
|
36 |
-
# Clone the repository into the working directory as root
|
37 |
-
RUN git clone -b ${BRANCH} ${REPO_URL} .
|
38 |
-
|
39 |
-
# Set correct ownership for the app directory and its contents
|
40 |
-
RUN chown -R user9:user9 /home/user9/app
|
41 |
-
|
42 |
-
# Set appropriate permissions for the app directory and its contents
|
43 |
-
RUN chmod -R u+rwX,go+rX,go-w /home/user9/app
|
44 |
-
|
45 |
-
# Ensure summarize.py is readable and executable
|
46 |
-
RUN chmod 755 /home/user9/app/summarize.py
|
47 |
-
|
48 |
-
# Switch to the "user9" user
|
49 |
-
USER user9
|
50 |
-
|
51 |
-
# Create and activate a virtual environment
|
52 |
-
RUN python3 -m venv venv
|
53 |
-
ENV PATH="/home/user9/app/venv/bin:$PATH"
|
54 |
-
|
55 |
-
# Upgrade pip and install wheel as the non-root user
|
56 |
-
RUN pip install --no-cache-dir --upgrade pip wheel
|
57 |
-
|
58 |
-
# Install CUDA libraries
|
59 |
-
RUN pip install --no-cache-dir nvidia-cublas-cu12 nvidia-cudnn-cu12
|
60 |
-
|
61 |
-
# Install PyTorch based on GPU support
|
62 |
-
RUN if [ "$GPU_SUPPORT" = "cuda" ]; then \
|
63 |
-
pip install torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 --index-url https://download.pytorch.org/whl/cu123; \
|
64 |
-
elif [ "$GPU_SUPPORT" = "amd" ]; then \
|
65 |
-
pip install torch-directml; \
|
66 |
-
else \
|
67 |
-
pip install torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 --index-url https://download.pytorch.org/whl/cpu; \
|
68 |
-
fi
|
69 |
-
|
70 |
-
# Install other Python dependencies
|
71 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
72 |
-
|
73 |
-
# Update config.txt for CPU if needed
|
74 |
-
RUN if [ "$GPU_SUPPORT" = "cpu" ]; then \
|
75 |
-
sed -i 's/cuda/cpu/' ./Config_Files/config.txt; \
|
76 |
-
fi
|
77 |
-
|
78 |
-
# Expose port 7860 to the outside world
|
79 |
-
EXPOSE 7860
|
80 |
-
|
81 |
-
# Set environment variable for Gradio to listen on all interfaces
|
82 |
-
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
83 |
-
|
84 |
-
# Define the default command to run the application
|
85 |
-
CMD ["python3", "summarize.py", "-gui"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|