diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..b23dd5862 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 +RUN apt-get update && apt-get install -y --no-install-recommends \ + python3-pip git libgl1-mesa-glx libglib2.0-0 && \ + apt-get clean && rm -rf /var/lib/apt/lists/* +COPY . /app +WORKDIR /app +RUN pip3 install --no-cache-dir -r requirements_versions.txt \ + torch==2.1.0 torchvision==0.16.0 --extra-index-url https://download.pytorch.org/whl/cu121 +RUN useradd -u 1000 -U -d /app -s /bin/false fooocus && \ + usermod -G users fooocus && \ + chown -R 1000:1000 /app +USER fooocus +CMD ["python3", "entry_with_update.py", "--listen"] diff --git a/readme.md b/readme.md index ab59d872a..e3c911fc8 100644 --- a/readme.md +++ b/readme.md @@ -120,6 +120,21 @@ Note that this Colab will disable refiner by default because Colab free's resour Thanks to [camenduru](https://github.com/camenduru)! +### Linux (Using Docker + Nvidia GPU) + +``` +git clone https://github.com/lllyasviel/Fooocus.git +cd Fooocus +docker build . -t fooocus +docker run -d --name=fooocus \ + -e NVIDIA_DRIVER_CAPABILITIES=compute,utility \ + -e NVIDIA_VISIBLE_DEVICES=all \ + -v /local/folder/fooocus/models:/app/models \ + -v /local/folder/fooocus/outputs:/app/outputs \ + -p 7865:7865 \ + --runtime=nvidia fooocus +``` + ### Linux (Using Anaconda) If you want to use Anaconda/Miniconda, you can