mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Simplify docker compose setup
This commit is contained in:
committed by
Kent Keirsey
parent
ea4ef042f3
commit
d1d8ee71fc
@ -1,11 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# This script is provided for backwards compatibility with the old docker setup.
|
||||
# it doesn't do much aside from wrapping the usual docker compose CLI.
|
||||
run() {
|
||||
local scriptdir=$(dirname "${BASH_SOURCE[0]}")
|
||||
cd "$scriptdir" || exit 1
|
||||
|
||||
SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
|
||||
cd "$SCRIPTDIR" || exit 1
|
||||
local build_args=""
|
||||
local service_name="invokeai-cpu"
|
||||
|
||||
docker compose up -d
|
||||
docker compose logs -f
|
||||
[[ -f ".env" ]] &&
|
||||
build_args=$(awk '$1 ~ /=[^$]/ {print "--build-arg " $0 " "}' .env) &&
|
||||
service_name="invokeai-$(awk -F '=' '/GPU_DRIVER/ {print $2}' .env)"
|
||||
|
||||
printf "%s\n" "docker compose build args:"
|
||||
printf "%s\n" "$build_args"
|
||||
|
||||
docker compose build $build_args
|
||||
unset build_args
|
||||
|
||||
printf "%s\n" "starting service $service_name"
|
||||
docker compose up -d $service_name
|
||||
docker compose logs -f
|
||||
}
|
||||
|
||||
run
|
||||
|
Reference in New Issue
Block a user