2022-10-24 22:03:48 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
2023-10-30 20:53:02 +00:00
|
|
|
run() {
|
|
|
|
local scriptdir=$(dirname "${BASH_SOURCE[0]}")
|
|
|
|
cd "$scriptdir" || exit 1
|
2023-10-19 15:25:47 +00:00
|
|
|
|
2023-10-30 20:53:02 +00:00
|
|
|
local build_args=""
|
|
|
|
local service_name="invokeai-cpu"
|
2022-12-16 12:53:37 +00:00
|
|
|
|
2023-10-30 20:53:02 +00:00
|
|
|
[[ -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
|