Move storage initialization into the backend executable

This commit is contained in:
2026-11-30 20:23:23 +08:00
parent 66be7099ec
commit af9f25baa5
11 changed files with 64 additions and 74 deletions
+2 -2
View File
@@ -25,12 +25,12 @@ release="$revision.${stage##*.}"
python3 "$(dirname "$0")/render-postgres.py" "$stage/bedrock.yaml" \
--deployment production --config-version "$release"
# The current binary is a one-shot storage initializer. It publishes no ports.
# Run storage initialization as a one-shot command in the release container.
docker run --rm --network "$network" \
--user "$(id -u):$(id -g)" --read-only --cap-drop ALL --security-opt no-new-privileges \
--mount "type=bind,source=$stage,target=/release,readonly" \
-e BEDROCK_DB_CONFIG=/release/bedrock.yaml \
debian:bookworm-slim /release/bedrock
debian:bookworm-slim /release/bedrock --init-storage
# Keep the final release private; only switch current after initialization succeeds.
python3 - "$stage" "$root" "$release" <<'PY'