Containers and orchestration
This page is for platform and DevOps teams in public bodies that run their applications in containers. It answers what the Exponential sources say about Docker, Podman and Kubernetes, what has to live outside the image, how many containers may write the default database, and how image tags and change approval fit together. The technical details are on the hosting pages Containers: Docker and Podman and Kubernetes; this page summarizes them and adds the public-sector angle.
Warning
.htaccess slows down every request. When .htaccess files are enabled (AllowOverride anything but None), let alone
used, Apache looks for them and reads and evaluates them on every request, in every directory of the path, and
page loading times go up drastically (measured). The only real fix is to switch the feature off for
the virtual host: AllowOverride None in the HTTPS virtual host, and the rules in the virtual host's own
configuration as mod_rewrite rules. That is far faster in production speed tests and well worth the time it takes
to optimize a production configuration. Switch over right away: copy the rules of the
example HTTPS virtual host into your virtual host (with the static cache, also
staticcache_offload.conf), set AllowOverride None, run apachectl configtest, reload Apache and
test the site. The same rules for other servers: nginx, LiteSpeed,
Caddy, IIS, Velocity (built in); where virtual host rules go in a control
panel: Plesk, cPanel, DirectAdmin, ISPConfig.
On LiteSpeed or OpenLiteSpeed, the server's own page cache can also answer anonymous visitors and crawlers without PHP: Page caching with LiteSpeed and OpenLiteSpeed.
Contents
- What the sources say
- Images and pinned tags
- What must persist
- One container or several
- Containers and your change process
- Checklist
What the sources say
- Docker and Podman are tier 2, known to work. Velocity publishes images on
ghcr.io/se7enxweb/exponential-velocityfor amd64 and arm64, one per PHP version and variant (Operating system support). - Kubernetes is tier 3, expected to work: a reasoned expectation, not a test result. The project asks to be told when someone runs it in production (Kubernetes).
- The sources ship no Kubernetes manifests. Your platform team writes them; the Kubernetes page lists the decisions they must encode.
exp:installis the install method for container images and automated test environments (Choosing an install method).
Images and pinned tags
Velocity's images are tagged by release, PHP version and variant (Velocity packages and binaries):
ghcr.io/se7enxweb/exponential-velocity:<release>-php<version>-<variant> fixed
ghcr.io/se7enxweb/exponential-velocity:php<version>-<variant> moves with each release
ghcr.io/se7enxweb/exponential-velocity:latest newest PHP, standard variantThe project's advice is "Pin a fixed tag in production." For a public body this is also a governance point: a change board approves a specific version, and only a fixed tag guarantees that the approved image is the one that runs. Record the tag in the change request.
Whatever base you use, run the extension check inside the built image as a pipeline step:
php bin/php/console exp:velocity ext checkWhat must persist
| Path | Holds | Where |
|---|---|---|
var/ | uploads (var/storage), caches, logs, the audit trail, the SQLite database | persistent volume |
settings/override | the installation's settings, database credentials, audit keys | persistent volume or secrets |
settings/siteaccess | siteaccess settings the installer writes | persistent volume |
kernel/, lib/, vendor/, extension/, design/ | code | in the image |
Files on the volume must belong to the user the container's PHP runs as; decide the user ID once for image and volume (Containers: Docker and Podman). Keep credentials out of the image itself.
config.php belongs with the code when it holds no secret: put it into place in the image build with
php bin/php/console exp:setup:config --apply --allow-root-user --owner=www-data:www-data and set values with
exp:config:set. A password (CLUSTER_STORAGE_PASS) is set at start from the platform's secrets. For the change
record, php bin/php/console exp:config:list --only-set --format=json documents what an image sets, with secrets
masked (Setting up .htaccess and config.php from the console).
One container or several
| One container | Several replicas | |
|---|---|---|
| Database | any supported engine, SQLite 3 included | a database server, PostgreSQL first |
| Uploaded files | one volume | shared storage for var/storage |
| Sessions | default files work | shared session storage |
| Cron | in the container or a scheduled job | exactly one scheduler |
SQLite "works in a container when one container writes the database": its WAL mode needs shared memory on one host, so several replicas cannot share one database file over a network volume. Moving from one replica to several is a project of its own: see High availability overview and Several web servers behind a load balancer.
Containers and your change process
Containers make some public-sector duties easier, if you use them for that:
- Reproducible builds. A pinned base image, a
composer.lockand your own extensions in version control give the same image every time. That is the evidence a change board asks for. - Staging equals production. Run the approved image on a test environment first, with test settings selected by
EXP_ENV(Environments for development, test and production). - No changes inside running containers. Switch on
ManagedByDeploymentso the administration cannot write settings or templates into a container that will be replaced (Configuration under version control). - Backups are still needed. A volume snapshot is not a tested backup; follow What to back up.
Checklist
- To do: Production runs a fixed image tag, recorded in the change request.
- To do:
exp:velocity ext checkruns in the image pipeline. - To do:
var/,settings/overrideandsettings/siteaccessare persistent; credentials are not in the image. - To do: Only one replica writes a SQLite database; several replicas use a database server.
- To do: One scheduler runs the cronjobs.
- To do:
ManagedByDeploymentis enabled on the administration siteaccess.
Related pages
- Hosting index of this folder
- Containers: Docker and Podman, Kubernetes
- Government and sovereign cloud hosting
- Setting up .htaccess and config.php from the console
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.