Blue-green on one host, which is two directories

The pattern does not require two machines, a load balancer or an orchestrator — it requires two copies and a pointer.

/srv/app/releases/2023-01-24-091402/
/srv/app/releases/2023-01-19-143007/
/srv/app/current -> releases/2023-01-24-091402

# the switch
ln -sfn "$release" /srv/app/current.new
mv -Tf /srv/app/current.new /srv/app/current
systemctl reload php-fpm

# rollback: the same two lines, pointed at the previous one

mv -T on a symlink is atomic on the same filesystem, which is what makes the switch instantaneous rather than a window where the path does not exist. The reload rather than a restart is what avoids dropping in-flight requests. Everything difficult about blue-green is in the database, and this pattern does nothing about that — which is the honest limit of it.