feat(deployment): add automated swap space configuration

- Create `scripts/setup-swap.sh` to dynamically detect and allocate
  a 4GB swap file to prevent OOM errors on low-RAM servers.
- Integrate the swap check gracefully into the `run.sh` orchestrator flow.
- Update `README.md` to document new sudo/disk space prerequisites
  and the updated deployment steps.
This commit is contained in:
2026-03-16 03:03:22 +08:00
parent 515d11e663
commit a521a88d38
3 changed files with 90 additions and 10 deletions

9
run.sh
View File

@@ -44,6 +44,15 @@ fi
echo -e "${GREEN}[OK] Critical variables are valid.${NC}\n"
echo -e "${GREEN}[OK] Critical variables are valid.${NC}\n"
if [ -f "./scripts/setup-swap.sh" ]; then
bash ./scripts/setup-swap.sh
else
echo -e "${YELLOW}[WARNING] ./scripts/setup-swap.sh not found. Skipping swap check.${NC}"
fi
echo ""
read -p "Do you want to run the auto-tune script to optimize GitLab for this server's RAM/CPU? (y/n): " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then