| [.env.production.example](file:///c:/Users/aglan/OneDrive/Documents/finalclubmanagementphp/.env.production.example) | Reference for env vars (never commit real values) |
---
## Step 1 — Push the New Files to GitLab
Run from your project folder on Windows (PowerShell):
| `DB_PASS` | *(your strong password from Step 2)* |
> [!NOTE]
> `srv-captain--club-db` is CapRover's internal DNS name for the `club-db` app. No external port needed.
---
## Step 5 — Run the Deploy Script
Copy [deploy.sh](file:///C:/Users/aglan/.gemini/antigravity/brain/e5406d02-837e-4c40-85b0-ac275104d02a/deploy.sh) to your server via SSH, **edit the top variables**, then:
```bash
# On your CapRover Ubuntu server via SSH:
nano deploy.sh # fill in the 6 config vars at the top
chmod +x deploy.sh
./deploy.sh
```
The script will:
1. Install Node.js + CapRover CLI if missing
2. Clone the GitLab repo fresh
3. Strip [code.sql](file:///c:/Users/aglan/OneDrive/Documents/finalclubmanagementphp/code.sql), `prompts/`, orphaned files from the build
4. Set env vars on the CapRover app via API
5. Enable HTTPS
6. Deploy the Docker image
---
## Step 6 — Alternative: Deploy Directly from GitLab CI (optional)
Add this `.gitlab-ci.yml` to your repo for automatic deploy on every push to `main`:
```yaml
deploy:
stage:deploy
image:node:20-alpine
script:
-npm install -g caprover
-caprover deploy
--caproverUrl $CAPROVER_URL
--caproverPassword $CAPROVER_PASSWORD
--appName club-management
--branch main
only:
-main
```
Set `CAPROVER_URL` and `CAPROVER_PASSWORD` as **masked CI/CD variables** in GitLab → Settings → CI/CD → Variables.
---
## Post-Deploy Verification
-[]`https://club-management.caprover.al-arcade.com` loads the login page
-[] Login with admin account works
-[] Check CapRover app logs for PHP errors
-[] Confirm `storage/logs/` is writable (CapRover container has `www-data` perms set in Dockerfile)
-[] Upload a file via the member module to verify `storage/uploads/` works
> [!WARNING]
> If you need persistent file uploads to survive re-deploys, go to CapRover → **App Configs** → **Persistent Directories** and add `/var/www/html/storage/uploads` mounted to a volume.