These scripts help you deploy, manage, and monitor your LeCommit application on Vultr.
First, make the scripts executable:
chmod +x deploy.sh rollback.sh check-status.shBuilds, pushes, and deploys your latest changes to the VPS.
./deploy.shWhat it does:
- ✅ Builds Docker image for AMD64 architecture
- ✅ Pushes to Vultr Container Registry
- ✅ Stops old container on VPS
- ✅ Starts new container with latest image
- ✅ Cleans up old images
- ✅ Verifies deployment success
Quickly revert to the previous version if something goes wrong.
./rollback.shWhat it does:
⚠️ Asks for confirmation- 🔄 Rolls back to previous Docker image
- ✅ Restarts container with older version
Check if your app is running correctly and view logs.
./check-status.shWhat it shows:
- 🌐 HTTP response status
- 🐳 Container running status
- 📝 Recent log entries
- 💡 Helpful commands
# 1. Make your code changes
# 2. Test locally with: cd frontend && npm run dev
# 3. Deploy to production:
./deploy.sh# 1. Check what's happening
./check-status.sh
# 2. If needed, rollback immediately
./rollback.sh# View live logs
ssh root@199.247.14.12 'docker logs -f lecommit-app'
# Check environment variables
ssh root@199.247.14.12 'docker exec lecommit-app env | sort'
# Restart container
ssh root@199.247.14.12 'docker restart lecommit-app'- Always test locally first before deploying
- Keep multiple versions - The rollback script needs at least 2 images
- Monitor after deployment - Use
check-status.shto verify - Update environment variables on VPS at
/opt/lecommit/.env.local
- SSH access to your VPS
- Docker installed locally
- Logged into Vultr Container Registry:
docker login https://lhr.vultrcr.com/lecommit1 \ -u 02a85eb8-61b3-4916-b8c4-d4b8d879244c \ -p gZ4DubSBGb4d9Qwskyi6mHe2GbEfzanJmQey
chmod +x deploy.sh rollback.sh check-status.shYou need to accept the VPS host key first:
ssh root@199.247.14.12
# Type 'yes' when promptedCheck the logs and environment variables:
ssh root@199.247.14.12 'docker logs lecommit-app'
ssh root@199.247.14.12 'cat /opt/lecommit/.env.local'