Fix running under Docker following 4.0.0rc4 config changes #6009
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
A new container without an existing root directory would fail to start due to permission issues and being unable to create the config file - this is fixed.
The
--host
CLI argument was removed as part of config optimization, and we were using it in the Dockerfile. Because the default bind host is 127.0.0.1, the app would not be accessible from outside the container (even from local host). Anyway, this PR addsINVOKEAI_HOST
andINVOKEAI_PORT
to the Dockerfile to provide working defaults that do not require additional intervention from the user.A couple of other improvements to the dockerized experience:
INVOKEAI_ROOT
can now be set to a relative path without using a dedicated env var pair for this purpose. The original (HOST_
andCONTAINER_
) root dir environment variables are retained because we know some users have these special use cases. Theenv.sample
file now explains their use more thoroughly.pip
do its thing. We do however still need to maintain theextra-index-url
logic in the Dockerfile to ensure cross-GPU compatibility.QA Instructions
docker
dir, and either executerun.sh
ordocker compose up
- this will run with all defaults.docker compose down
), then try to setINVOKEAI_ROOT
to a new path on the filesystem, and run it again. In all cases, the container should start and the new 4.0 UI should be usable as expected.Merge Plan
Merge at will
Checklist