feat(deploy): add center host docker compose stack for git, registry and s3 hosting

This commit is contained in:
zetaloop
2026-05-05 08:45:58 +08:00
parent d1ff2661d1
commit 2a41969771
9 changed files with 443 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -euo pipefail
GARAGE="docker compose exec -T garage /garage"
NODE_ID="$($GARAGE node id -q | cut -d@ -f1 | tr -d '\r')"
echo "node id: $NODE_ID"
$GARAGE layout assign -z dc1 -c 10G "$NODE_ID"
$GARAGE layout apply --version 1
$GARAGE bucket create juwan-objectstory
$GARAGE bucket create juwan-pg-backup
KEY_INFO="$($GARAGE key create juwan-app)"
echo "$KEY_INFO"
ACCESS_KEY="$(echo "$KEY_INFO" | awk '/Key ID:/ {print $3}')"
SECRET_KEY="$(echo "$KEY_INFO" | awk '/Secret key:/ {print $3}')"
$GARAGE bucket allow --read --write --owner juwan-objectstory --key juwan-app
$GARAGE bucket allow --read --write --owner juwan-pg-backup --key juwan-app
cat <<EOF
S3_ENDPOINT=https://s3.juwan.xhttp.zip
S3_REGION=garage
S3_ACCESS_KEY=$ACCESS_KEY
S3_SECRET_KEY=$SECRET_KEY
S3_BUCKET_NAME=juwan-objectstory
EOF