Spaces:
Running
on
Zero
Running
on
Zero
FROM pytorch/pytorch:2.1.0-cuda11.8-cudnn8-runtime | |
ENV DEBIAN_FRONTEND=noninteractive | |
RUN apt-get update && apt-get install -y git libgl1-mesa-glx libglib2.0-0 | |
RUN useradd -m -u 1000 user | |
USER user | |
ENV HOME=/home/user \ | |
PATH=/home/user/.local/bin:$PATH \ | |
PYTHONPATH=$HOME/app \ | |
PYTHONUNBUFFERED=1 \ | |
GRADIO_ALLOW_FLAGGING=never \ | |
GRADIO_NUM_PORTS=1 \ | |
GRADIO_SERVER_NAME=0.0.0.0 \ | |
GRADIO_THEME=huggingface \ | |
GRADIO_SHARE=False \ | |
SYSTEM=spaces | |
# Set the working directory to the user's home directory | |
WORKDIR $HOME/app | |
# Clone your repository or add your code to the container | |
RUN git clone https://github.com/fffiloni/style-aligned.git $HOME/app | |
# Install dependencies | |
RUN pip install --no-cache-dir -r requirements.txt gradio spaces | |
COPY app.py . | |
RUN find $HOME/app | |
# Set the environment variable to specify the GPU device | |
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID | |
ENV CUDA_VISIBLE_DEVICES=0 | |
# Run your app.py script | |
CMD ["python", "app.py"] | |