Docker¶
These complete configurations require a valid Trident Core licence at
/etc/trident/license.key, readable by the service user. The explicit
license.path below selects that file; mounting a licence without configuring
its path does not activate caching. A successful --check validates the
configuration, not the entitlement. Verify licensed runtime status and a
cacheable MISS followed by HIT with identical complete bodies.
These instructions describe the 1.8.0 candidate configuration. Select the actual qualified image reference; documentation preparation does not publish an image or establish that an unreleased version tag exists. For production, record and pin the delivered image digest.
Complete configuration¶
Save the following as config.json. Replace example.com with your real
hostname. origin is the backend service name on the same Docker network;
use your actual origin host when adapting this deployment.
{
"license": {
"path": "/etc/trident/license.key"
},
"security": {
"trusted_proxies": []
},
"server": {
"listeners": [
{
"address": "0.0.0.0:8120"
}
],
"preserve_host": true
},
"backends": [
{
"name": "origin",
"host": "origin",
"port": 80
}
],
"cache": {
"max_memory": "1 GiB",
"poisoning": {
"known_hosts": [
"example.com",
"localhost",
"127.0.0.1"
]
}
},
"admin": {
"address": "127.0.0.1:6085",
"auth_token": "${TRIDENT_ADMIN_TOKEN}"
}
}
TRIDENT_ADMIN_TOKEN in the container environment. Keep
real token values and licence files out of source control. Ensure mounted
licence/configuration files are readable by the image's service user.
Validate before running¶
Set TRIDENT_IMAGE to the delivered image reference and provide the same
admin-token environment and files that the service will use:
docker pull "${TRIDENT_IMAGE:?select the qualified image}"
docker run --rm \
-e TRIDENT_ADMIN_TOKEN \
-v "$PWD/config.json:/etc/trident/config.json:ro" \
-v "$PWD/license.key:/etc/trident/license.key:ro" \
"$TRIDENT_IMAGE" --config /etc/trident/config.json --check
--check does not contact the origin or prove container readiness. It must
succeed before routing production traffic to an instance. An invalid or expired
licence can change cache behaviour even when a process responds; validate the
licence and cache outcome as part of the deployment checks.
Docker Compose¶
This example explicitly selects the mounted JSON file. Change the origin service to the real application before using it in production.
services:
origin:
image: nginx:alpine
trident:
image: ${TRIDENT_IMAGE:?select the qualified image reference}
command: ["--config", "/etc/trident/config.json"]
environment:
TRIDENT_ADMIN_TOKEN: ${TRIDENT_ADMIN_TOKEN:?provide an operator-managed token}
ports:
- "127.0.0.1:8120:8120"
volumes:
- ./config.json:/etc/trident/config.json:ro
- ./license.key:/etc/trident/license.key:ro
healthcheck:
test: ["CMD", "curl", "--fail", "--silent", "http://127.0.0.1:6085/admin/ready"]
interval: 10s
timeout: 2s
retries: 3
start_period: 10s
restart: unless-stopped
Only the proxy port is published, bound to host loopback. When an external TLS edge runs on the same host, use the documented nginx or Apache forwarding contract and configure its immediate address as a trusted proxy. Docker bridge peers may not appear as 127.0.0.1: determine the actual peer address and restrict that network. Do not trust all client networks to make forwarding headers work.
The admin readiness route is reached from inside the container and does
not need a public admin port. An origin /health request on the proxy listener
is ordinary application traffic and must not be confused with admin readiness.
Verify and update¶
docker compose exec trident trident --version
docker compose exec trident trident-cli --version
curl -i -H 'Host: example.com' http://127.0.0.1:8120/
Check exact public/private bodies, cache outcomes and origin access with your application. A version string alone does not prove which image/binary/config is installed. Record the image digest and effective configuration alongside the checks. Readiness, a valid licence and demonstrated cache hits are distinct observations.
To update, set the reviewed next image digest, validate its configuration, then recreate the instance. Keep the old digest/configuration and follow the release's tested rollback and cold-cache procedure.
Recreating a single instance can interrupt service; it is not a zero-downtime guarantee. Scaling a Compose service with a fixed published host port does not create a working rolling update. Existing multi-instance deployments need their load-balancer drain and rollback procedure qualified independently.