MuseV / scripts /gradio /Dockerfile
jmanhype
refactor: switch to NVIDIA CUDA base image and improve Dockerfile structure
7c2f064
raw
history blame
1.8 kB
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
# Install system dependencies
USER root
RUN apt-get update && apt-get install -y \
python3.10 \
python3-pip \
git \
wget \
curl \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# Set up git config file
RUN rm -rf /etc/gitconfig && \
touch /etc/gitconfig && \
chmod 666 /etc/gitconfig && \
git config --system user.email "[email protected]" && \
git config --system user.name "jmanhype"
# Create necessary directories with proper permissions
RUN mkdir -p /home/user/.config/matplotlib && \
mkdir -p /home/user/app/flagged && \
chown -R 1000:1000 /home/user/.config && \
chown -R 1000:1000 /home/user/app && \
chmod -R 777 /home/user/.config && \
chmod -R 777 /home/user/app
# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user
# Switch to the "user" user
USER user
# Set home to the user's home directory and configure matplotlib
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
SKIP_VSCODE=true \
DISABLE_VSCODE_INSTALLATION=true \
HF_SPACE_NO_VSCODE=true \
MPLCONFIGDIR=/home/user/.config/matplotlib
# Set the working directory to the user's home directory
WORKDIR $HOME/app
# Install Python dependencies
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Clone repository without git config
RUN git clone -b hg_space --recursive https://github.com/TMElyralab/MuseV.git
# Set permissions
RUN chmod -R 777 /home/user/app/MuseV
WORKDIR /home/user/app/MuseV/scripts/gradio/
# Add entrypoint script
COPY --chown=user entrypoint.sh ./entrypoint.sh
RUN chmod +x ./entrypoint.sh
EXPOSE 7860
CMD ["./entrypoint.sh"]