Deployment regels en commando's voor de Luxis VPS
~/.ssh/luxis_deploy (passphrase-vrij)ssh -i ~/.ssh/luxis_deploy [email protected]/opt/luxisCOMPOSE_FILE staat in .env → gewoon docker compose werktNa commit + push → deploy automatisch via SSH. Geen commando aan gebruiker geven.
ssh -i ~/.ssh/luxis_deploy [email protected] "cd /opt/luxis && git pull && docker compose build frontend && docker compose up -d frontend && docker image prune -f"
ssh -i ~/.ssh/luxis_deploy [email protected] "cd /opt/luxis && git pull && docker compose build backend && docker compose up -d backend && docker image prune -f"
ssh -i ~/.ssh/luxis_deploy [email protected] "cd /opt/luxis && git pull && docker compose run --rm backend python -m alembic upgrade head && docker compose build backend && docker compose up -d backend && docker image prune -f"
ssh -i ~/.ssh/luxis_deploy [email protected] "cd /opt/luxis && git pull && docker compose run --rm backend python -m alembic upgrade head && docker compose build backend frontend && docker compose up -d && docker image prune -f"
--no-cache — wanneer wel / nietStandaard: GEEN --no-cache. Docker's layer cache is betrouwbaar met onze Dockerfiles (deps eerst, code pas daarna). Sessie 120 incident: elke sessie met --no-cache bouwt ~20-30GB aan build-cache die niet wordt opgeruimd → na 4 sessies was de VPS 143GB vol en Postgres crash-loopte.
Alleen --no-cache bij:
pyproject.toml of package-lock.json gewijzigd EN je wilt 100% zekerheid dat deps opnieuw geïnstalleerd wordenNa deploy altijd docker image prune -f (zonder -a) — ruimt alleen dangling images van vorige builds op. Nooit tagged rollback-images.
scripts/disk_guard.sh draait elk uur via cron. Bij >85% safe prune, bij >95% emergency prune (cache + dangling only, nooit tagged images).docker builder prune -f --filter "until=168h"./var/log/luxis-disk.log — check bij twijfel of het WARNING/ALERT regels heeft.df -h / handmatig bij vreemd deploy-gedrag om vroege diagnose.ssh -i ~/.ssh/luxis_deploy [email protected] "cd /opt/luxis && docker compose ps && docker compose logs backend --tail 5"
run niet exec als backend crashedALTER USERgit push origin main — anders bereikt het de VPS niet