Skip to content

Commit

Permalink
Merge branch 'develop' into docker
Browse files Browse the repository at this point in the history
# Conflicts:
#	modules/config.py
  • Loading branch information
mashb1t committed Feb 26, 2024
1 parent b48ff50 commit dd3a540
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,31 @@ 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`.

## Details

### 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):
```
#- ./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.


Expand Down Expand Up @@ -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".
- 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.

0 comments on commit dd3a540

Please sign in to comment.