|
|
|
FROM nvidia/cuda:12.4.1-base-ubuntu22.04
|
|
|
|
|
|
RUN apt-get update -y && apt-get install -y \
|
|
python3-pip \
|
|
python3-dev \
|
|
git \
|
|
build-essential
|
|
|
|
|
|
ENV PUID=${PUID:-1000}
|
|
ENV PGID=${PGID:-1000}
|
|
|
|
|
|
RUN groupadd -g "${PGID}" appuser
|
|
|
|
RUN useradd -m -s /bin/sh -u "${PUID}" -g "${PGID}" appuser
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
RUN git clone -b sd3 https://github.com/kohya-ss/sd-scripts && \
|
|
cd sd-scripts && \
|
|
pip install --no-cache-dir -r ./requirements.txt
|
|
|
|
|
|
COPY ./requirements.txt ./requirements.txt
|
|
RUN pip install --no-cache-dir -r ./requirements.txt
|
|
|
|
|
|
RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
|
|
|
|
RUN chown -R appuser:appuser /app
|
|
|
|
|
|
RUN rm -r ./sd-scripts
|
|
RUN rm ./requirements.txt
|
|
|
|
|
|
USER appuser
|
|
|
|
|
|
COPY . ./fluxgym
|
|
|
|
EXPOSE 7860
|
|
|
|
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
|
|
|
WORKDIR /app/fluxgym
|
|
|
|
|
|
CMD ["python3", "./app.py"] |