| FROM nvidia/cuda:12.2.0-runtime-ubuntu22.04 |
|
|
| RUN apt-get update && apt-get install -y \ |
| wget \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| RUN useradd -ms /bin/bash app |
| ADD --chown=1000:1000 . /ai-cards |
| USER app |
| WORKDIR ai-cards |
|
|
| RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ |
| chmod +x Miniconda3-latest-Linux-x86_64.sh && \ |
| ./Miniconda3-latest-Linux-x86_64.sh -b && \ |
| rm Miniconda3-latest-Linux-x86_64.sh |
| USER root |
| RUN ln -s /home/app/miniconda3/bin/conda /usr/bin/conda |
| USER app |
|
|
| RUN conda env create -f environment.yaml |
| RUN ["conda", "run", "-n", "ai-cards", "--no-capture-output", "/bin/bash", "-c", "pip install pygit2==1.12.2 && python prepare.py"] |
|
|
| VOLUME /ai-cards/models/checkpoints |
| VOLUME /ai-cards/models/loras |
| EXPOSE 7860 |
|
|
| ENV SYSTEM=spaces SPACE_ID=QualityMinds/Siemens-Kartengenerator |
| ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "ai-cards", "python", "launch.py"] |
|
|