fix: revert deployer to root and fix permissions in script
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user