From dd3a5402d4a9e55249dba7a1f176dc9e791ec06d Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Mon, 26 Feb 2024 17:24:36 +0100 Subject: [PATCH] Merge branch 'develop' into docker # Conflicts: # modules/config.py --- docker.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/docker.md b/docker.md index 46fcb933a5..36cfa632ad 100644 --- a/docker.md +++ b/docker.md @@ -4,11 +4,13 @@ The docker image is based on NVIDIA CUDA 12.3 and PyTorch 2.0, see [Dockerfile]( ## Quick start -**This is just an easy way for testing. Please also see [Notes](#notes) for using it in a production environment.** +**This is just an easy way for testing. Please find more information in the [notes](#notes).** -Clone this repository, then run the docker container with `docker compose up --build` -Building the image takes some time. -When you see the message `Use the app with http://localhost:7865/` in the console, you can access the URL in your browser. +1. Clone this repository +2. Build the image with `docker compose build` +3. Run the docker container with `docker compose up`. Building the image takes some time. + +When you see the message `Use the app with http://0.0.0.0:7865/` in the console, you can access the URL in your browser. Your models and outputs are stored in the `fooocus-data` volume, which, depending on OS, is stored in `/var/lib/docker/volumes`. @@ -16,8 +18,9 @@ Your models and outputs are stored in the `fooocus-data` volume, which, dependin ### Update the container manually -When you are using `docker compose up --build` continuously, the container is not updated to the latest version of Fooocus automatically. -Run `git pull` before executing `docker compose up --build` to update Fooocus. +When you are using `docker compose up` continuously, the container is not updated to the latest version of Fooocus automatically. +Run `git pull` before executing `docker compose build --no-cache` to build an image with the latest Fooocus version. +You can then start it with `docker compose up` ### Import models, outputs If you want to import files from models or the outputs folder, you can uncomment the following settings in the [docker-compose.yml](docker-compose.yml): @@ -25,7 +28,7 @@ If you want to import files from models or the outputs folder, you can uncomment #- ./models:/import/models # Once you import files, you don't need to mount again. #- ./outputs:/import/outputs # Once you import files, you don't need to mount again. ``` -After running `docker compose up --build`, your files will be copied into `/content/data/models` and `/content/data/outputs` +After running `docker compose up`, your files will be copied into `/content/data/models` and `/content/data/outputs` Since `/content/data` is a persistent volume folder, your files will be persisted even when you re-run `docker compose up --build` without above volume settings. @@ -58,4 +61,6 @@ See examples in the [docker-compose.yml](docker-compose.yml) ## Notes - Please keep 'path_outputs' under '/content/app'. Otherwise, you may get an error when you open the history log. -- Docker on Mac/Windows still has issues in the form of slow volume access when you use "bind mount" volumes. Please refer to [this article](https://docs.docker.com/storage/volumes/#use-a-volume-with-docker-compose) for not using "bind mount". \ No newline at end of file +- Docker on Mac/Windows still has issues in the form of slow volume access when you use "bind mount" volumes. Please refer to [this article](https://docs.docker.com/storage/volumes/#use-a-volume-with-docker-compose) for not using "bind mount". +- The MPS backend (Metal Performance Shaders, Apple Silicon M1/M2/etc.) is not yet supported in Docker, see https://github.com/pytorch/pytorch/issues/81224 +- You can also use `docker compose up -d` to start the container detached and connect to the logs with `docker compose logs -f`. This way you can also close the terminal and keep the container running. \ No newline at end of file