25 lines
790 B
Bash
Executable File
25 lines
790 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
cd "$(dirname "$0")/.."
|
|
tmp=$(mktemp -d)
|
|
trap 'rm -rf "$tmp"' EXIT HUP INT TERM
|
|
mkdir -p "$tmp/deploy"
|
|
cp compose.yaml "$tmp/compose.yaml"
|
|
: >"$tmp/deploy/thothii.env"
|
|
|
|
docker compose --project-directory "$tmp" -f "$tmp/compose.yaml" config --format json >"$tmp/config.json"
|
|
node - "$tmp/config.json" <<'NODE'
|
|
const fs = require("fs");
|
|
const config = JSON.parse(fs.readFileSync(process.argv[2], "utf8"));
|
|
if (!config.networks?.localllm_default?.external) {
|
|
throw new Error("localllm_default must be an external network");
|
|
}
|
|
if (!config.services?.core?.networks?.localllm_default) {
|
|
throw new Error("core must join localllm_default");
|
|
}
|
|
if (config.services?.frontend?.networks?.localllm_default) {
|
|
throw new Error("frontend must not join the model network");
|
|
}
|
|
NODE
|