fix: revert deployer to root and fix permissions in script

This commit is contained in:
2026-01-26 00:35:26 +09:00
parent 2c95fe49f3
commit bd43c99221
2 changed files with 14 additions and 1 deletions

View File

@@ -45,4 +45,18 @@ bash "$SRC/scripts/deploy-nas.sh"
cd "$DST"
docker-compose up -d --build backend travel-proxy frontend
# [Permission Fix]
# deployer가 root로 돌면서 생성한 파일들의 소유권을 호스트 사용자로 변경
# .env에 정의된 PUID:PGID가 있으면 사용, 없으면 1000:1000
TARGET_UID=$(grep PUID .env | cut -d '=' -f2 || echo 1000)
TARGET_GID=$(grep PGID .env | cut -d '=' -f2 || echo 1000)
echo "Fixing permissions to $TARGET_UID:$TARGET_GID ..."
chown -R "$TARGET_UID:$TARGET_GID" "$DST" || true
# Repo 쪽도 혹시 모르니
if [ "$SRC" != "$DST" ]; then
chown -R "$TARGET_UID:$TARGET_GID" "$SRC" || true
fi
echo "DEPLOY_OK $TAG"