Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Enhance Docker compose setup for improved extension handling
- Bind additional directories to the script folder in Docker Compose setup to fix extensions that don't respect the `--data-dir` rule. - Add binding for a `ui-config.json` file in the Docker Compose configuration. Signed-off-by: 陳鈞 <jim60105@gmail.com>
- Loading branch information
b08dfa4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like a file? But after the container is started for the first time, the ui-config.json created in ./data/ is actually a folder~
Is this the reason for the error reported after starting the container below?
b08dfa4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this will definitely be a issue.
Docker will create a folder there when the source file does not exist (and will bind into the file if it exists).
So this modification will cause problems when running for the first time when sd-webui has not yet created files.
I'll think of another solution.
b08dfa4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your prompt response, and thank you even more for creating this Docker image that is much smaller than the mainstream auto1111. I have learned a lot from your build files. Please allow me to express my gratitude once again~
Regarding this issue, if we first create /app/ui-config.json in the Dockerfile, I wonder if there will be any other side effects?
b08dfa4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that the parameter --data-dir /data will change the original paths of cache.json, extensions/, models/, scripts/, ui-config.json located under /app/ to the path /data. Perhaps the mounting path of the host machine can be divided into 2 layers.
Then change the mounted volume in docker-compose.yml to this.
It seems to be working fine now.
b08dfa4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm glad that someone likes it, that's why I enjoy working on open source projects.😄
I tested it and found that the empty JSON file works. Users will now receive one when cloning the git repository.
And I chose a different approach that does not automatically generate an empty directory.
Fixed this issue in 069a7b3.
b08dfa4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When starting up after pulling the latest version, Docker complains that it cannot find data/scripts and then exits abruptly.
b08dfa4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for your inconvenience, it should be fixed now. ca0e5ca
Please pull the new image after the CI process completed or build it locally.
b08dfa4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ca0e5c is now running smoothly, thank you for your prompt fix. The image built by your Dockerfile is much smaller than other machine learning images, which is really awesome!
The following two user experiences may help new users save some time.
If UID 1001 does not exist on the host machine.
ARG UID=1001
in Dockerfile,user: "1001:0"
in docker-compose.yml needs corresponding modifications.