Skip to content

Updating servers

As a general approach, the servers should be upgraded before the application. E.g. a PHP 8.2 app can run on 8.3 (if deprecations have been solved) but not the other way around.

Updating configurations

If you just want to update the configuration of e.g. Caddy, PHP, or the Docker compose YML file, the only thing you need to do is update the file and run the command below.

If you're updating php.Dockerfile because you want to upgrade PHP, Composer, Node, or npm to a newer version or want to install additional packages, increase the version number of the docker_image_version Deployer variable in deploy.php and in resources/server/Docker/docker-swarm-production.yml. The Deployer recipe will detect this change and build a new image on each server when running the command, then update the swarm stack to use that image.

All updates are applied in a rolling matter, i.e. only one service replica is updated at a time and when a failure occurs, it's disabled and the update process is halted to avoid affecting other replicas. This ensures that there are always other service replicas up and running to handle traffic.

Note: to avoid having to build multi-arch images for php.Dockerfile and publishing them to a paid registry, we build the image ourselves manually on each node.

Of course, it's always best to try these changes locally first!

DANGER

Make sure you're updating the correct environment

shell
dep app:docker env=production

Updating a server

  1. Disable the endpoint in the load balancer
  2. Run dep app:update and select the server to update