Docs/Networking

Networking

VersionGate manages an Nginx upstream file and a dedicated Docker network. Traffic switching is a config rewrite plus reload — never a restart.

Ports and slots

Each environment reserves two host ports: basePort (blue) and basePort + 1 (green). Inside the container your app listens on appPort; Docker maps it to the slot's host port.

Nginx upstream switching

/etc/nginx/conf.d/upstream.conf
upstream myapp {
    server 127.0.0.1:3101;   # rewritten by VersionGate on every switch
}

After a health-checked deploy, VersionGate rewrites the upstream port and runs nginx -s reload. Existing connections drain gracefully; new requests hit the new container.

Docker network

terminal
docker network create versiongate-net

All deployed containers join versiongate-net (configurable via DOCKER_NETWORK), so services can reach each other by container name.

Domains & HTTPS

Settings → Dashboard URL lets you set PUBLIC_DOMAIN and provision certificates via Certbot. Preflight validates DNS resolution, certbot availability, and CERTBOT_EMAIL before attempting issuance.

Webhook endpoints

The official VersionGate GitHub App sends webhooks to https://versiongate.tech/api/webhooks/github. The public relay looks up your installation and forwards the event to {PUBLIC_URL}/api/webhooks/github/relay on your VPS (verified with GITHUB_STATE_SECRET). Direct {PUBLIC_URL}/api/webhooks/github remains available for local testing. Legacy per-project webhooks (/api/v1/webhooks/:secret) continue to work without the App.

Behind PM2 with a minimal PATH?
If Docker is installed but PM2 strips your PATH, set DOCKER_BIN=/usr/bin/docker in .env.