Add project-scoped Codex execution over a private socket
This commit is contained in:
+14
-1
@@ -44,7 +44,20 @@ docker network inspect "$network" >/dev/null
|
||||
release=$(mktemp -d "$foundry/release.XXXXXXXX")
|
||||
install -m 755 "$1" "$release/foundry"
|
||||
export HOST=0.0.0.0 PORT=8080 PUBLIC_ORIGIN="$origin"
|
||||
docker run -d --name "$candidate" --network "$network" \
|
||||
codex_mounts=()
|
||||
codex_dir=$foundry/codex
|
||||
if [[ -d "$codex_dir" ]]; then
|
||||
test -S "$codex_dir/run/worker.sock"
|
||||
test -s "$codex_dir/grants/projects.json"
|
||||
codex_mounts=(
|
||||
--mount "type=bind,source=$codex_dir/run,target=/run/foundry-codex,readonly"
|
||||
--mount "type=bind,source=$codex_dir/grants,target=/etc/foundry-codex,readonly"
|
||||
-e FOUNDRY_CODEX_SOCKET=/run/foundry-codex/worker.sock
|
||||
-e FOUNDRY_CODEX_GRANTS=/etc/foundry-codex/projects.json
|
||||
)
|
||||
fi
|
||||
|
||||
docker run -d --name "$candidate" "${codex_mounts[@]}" --network "$network" \
|
||||
--env-file "$foundry/database.env" -e HOST -e PORT -e PUBLIC_ORIGIN \
|
||||
-e GOOGLE_CLIENT_ID -e GOOGLE_CLIENT_SECRET -e FOUNDRY_PROJECTS \
|
||||
--user 1000:1000 --cap-drop ALL --security-opt no-new-privileges \
|
||||
|
||||
Reference in New Issue
Block a user