Overview
Stack
- 1 global Cloudflare load balancer (includes CF's standard protections like DDoS, WAF, auto-HTTPS, …)
- 2 geographically separate Docker swarm clusters (AMS and FRA)
- Swarm 1: AMS3 worker, AMS3 web
- Swarm 2: FRA1 web
- Web servers in different countries and data centers
- Serves HTTP requests with Caddy
- Processes PHP requests with PHP-FPM
- Runs the Laravel scheduler
- Connects to the CF load balancer using a CF Tunnel (think of it as a reverse VPN)
- 1 worker server
- Same as web servers but also runs Horizon
- 1 managed MySQL database on DigitalOcean
- 1 managed Redis database on DigitalOcean
The Cloudflare load balancer is in charge of global geo routing based on the configured pools (geographical clusters of servers) and individual nodes (servers, droplets). Requests are relayed to nodes via isolated Cloudflare Tunnels and then picked up by one of the Docker swarm Caddy replicas on the node. In case one or all replicas of a Docker service (Caddy or PHP) on a node cannot process requests, the swarm internally reroutes the request to any other physical node where the service task is running and available. Docker swarm’s internal mechanisms ensure high availability and efficient load distribution during updates, upgrades, or critical failures.
Locations
- Trial: https://smarthealth-app-trial.shdev.nl
- Staging: https://smarthealth-app-staging.shdev.nl
- Production: https://app.smarthealth.works