Spaces:
Running
on
A10G
Running
on
A10G
File size: 1,491 Bytes
88491fe b3ba317 631adf1 cb850a3 631adf1 4945776 cb850a3 631adf1 88491fe 631adf1 88491fe e242bbe 631adf1 e242bbe 631adf1 ae8211c 4fb5ca8 631adf1 1bf3bbb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# Use the base image with your launcher
FROM thecooltechguy/comfyui_launcher AS launcher
# Create a non-root user first
RUN useradd -m -u 1000 user
# Fix all permission issues for unknown images
RUN chown -R user:user / || true
# Install Nginx as root
USER root
RUN apt-get update && \
apt-get install -y nginx && \
rm -rf /var/lib/apt/lists/*
# Configure Nginx to act as a reverse proxy
RUN rm /etc/nginx/sites-enabled/default
COPY nginx.conf /etc/nginx/sites-enabled/
COPY start.sh /start.sh
# Ensure proper permissions for Nginx directories
RUN chown -R user:user /var/lib/nginx /var/log/nginx /var/www/html /start.sh
RUN chmod +x /start.sh
# Setup symlink to use /data instead of /app
RUN mkdir /data && chown user:user /data
RUN ln -s /data /app
# Install CUDA Toolkit 12.4 base installer and NVIDIA driver
RUN apt-get update && apt-get install -y wget gnupg2 software-properties-common
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.1-1_all.deb
RUN dpkg -i cuda-keyring_1.1-1_all.deb
RUN apt-get update
# Installing CUDA Toolkit 12.4
RUN apt-get -y install cuda-toolkit-12-4
# Installing NVIDIA Drivers (Legacy Kernel Module Flavor)
RUN apt-get install -y cuda-drivers
# Setting up environment variables for CUDA
ENV PATH=/usr/local/cuda-12.4/bin:${PATH}
ENV LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64:${LD_LIBRARY_PATH}
# Switch back to the non-root user for running applications
USER user
ENTRYPOINT ["/start.sh"] |