Team Ai
Apppublic

medmekk/BitNet.cpp

sourceHugging Faceupdated 2y agoView on Hugging Face
18likes
Dockerfile50 linesDownload Raw Back to root
1# Use an official Python runtime as a parent image2FROM python:3.10-slim3 4# Install git as root5RUN apt-get update && \6    apt-get install -y wget gnupg nmap && \7    # Add the LLVM repository for clang8    wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \9    echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-15 main" > /etc/apt/sources.list.d/llvm-toolchain.list && \10    apt-get update && \11    apt-get install -y git cmake clang && \12    rm -rf /var/lib/apt/lists/*13 14# Create a non-root user (do this as root)15RUN useradd -ms /bin/bash user16 17# Set the working directory as root before switching users18WORKDIR /home/user/app19 20# Copy files and change permissions as root21COPY requirements.txt /home/user/app/requirements.txt22COPY setup.sh /home/user/app/setup.sh23RUN chmod +x /home/user/app/setup.sh24 25# Install Python dependencies as root26RUN pip install --no-cache-dir -r /home/user/app/requirements.txt27 28# Run setup.sh as root (if it needs elevated privileges)29RUN /home/user/app/setup.sh30 31# Change ownership of the directory to user32RUN chown -R user:user /home/user/app33 34# Switch to the non-root user35USER user36 37 38RUN ls /home/user/app39# Copy the rest of the application code to the container (as user)40COPY . /home/user/app41 42# Expose the necessary port43EXPOSE 786044 45# Set environment variable for Gradio46ENV GRADIO_SERVER_NAME="0.0.0.0"47 48# Command to run the application49CMD ["python", "app.py"]50