Copy the example environment file:
cp .env.example .envEdit the .env file to set the correct secret values for your environment.
Link production config files and directories:
ln -s config_prod config
ln -s .env.nosecret-prod .env.nosecret
ln -s .env.prod .envProduction servers do not require a proxy.
docker compose --env-file ./.env.prod --env-file ./.env.nosecret-prod upor
docker compose --env-file ./.env.prod --env-file ./.env.nosecret-prod --profile barista up -dLink dev config files and directories:
ln -s config_dev config
ln -s .env.nosecret-dev .env.nosecret
ln -s .env.dev .envRunning in staging (detached mode), with the watchtower service that updates the images every 5 minutes:
docker compose \
--env-file ./.env \
--env-file ./.env.nosecret \
--profile barista \
-f docker-compose.yml -f docker-compose.watcher.yml \
-p impresso up -dReading logs in production:
docker compose logs -fThe .env.example contains latest images of the services in docker-compose and it is for development purposes.
Running outside of the production servers requires a proxy.
docker compose --env-file ./.env --env-file ./.env.nosecret --profile with_proxy upIf barista service needs to be enabled, add --profile barista to the command above.
docker compose --env-file ./.env --env-file ./.env.nosecret --profile with_proxy --profile barista upDocker compose expects several files located in config directory.
Several directories are provided for different configurations:
config_prod- production configurationconfig_dev- development configuration
To use the suitable configuration, create a symlink to the desired configuration directory:
ln -s config_prod confignginx/nginx.conf is shared by all environments and mounted directly by
docker compose (it is not part of the config directories). Its Lua filters
live in scripts/.
Vector ships stdout and stderr from both middle layers, Nginx, Barista, its
knowledge-base bootstrap job, user admin, Celery, the auth service, Meilisearch,
and Dragonfly to VictoriaLogs. Middle-layer JSON records retain their
application timestamp, level, logger, and structured properties.
Django JSON records use asctime in UTC and expose level, logger,
filename, and lineno. Auth-service access records expose level, client,
client_port, method, path, http_version, and status. Nginx access
logs expose those same request fields except level and client_port, plus
request ID, timing, upstream status, and the public API user ID when present.
Access paths omit query strings. Nginx error logs expose severity and request
or upstream details when available. Meilisearch emits JSON logs with level,
logger, and tracing fields. HTTP records also expose method, path, and
status. Dragonfly logs and unparsed lines remain searchable as text.
Use container_name and stream to filter by container and by stdout or
stderr. Logs persist in the victorialogs-data volume for 30 days by default. Set
VICTORIALOGS_RETENTION_PERIOD to change retention.
Sign in to the Impresso app with a staff account, then open /int/logs/
on the same origin. Use HTTPS for deployed sites. HTTP is supported on
localhost. OpenResty verifies the app's feathers-jwt signature and expiry,
accepts the configured app audience hostname or a loopback hostname, and
requires the signed isStaff claim to be true for the UI and query API.
The browser session lasts up to 15 minutes. Reload the UI to sign in again
after it expires. Vector sends logs over the Compose network.
When deploying the /int/logs prefix, recreate victorialogs, nginx, and
vector together so the proxy and ingestion use the same path.
Start or restart Vector with the updated configuration before running the one-shot bootstrap job. Vector collects Docker logs from the time it starts. Vector writes audit events to S3.
Run Vector as a trusted service on the Docker host. It uses the Docker API to read container logs. The read-only socket mount does not restrict Docker API permissions.
Vector's own warnings and errors appear in VictoriaLogs under
service:vector stream:internal. A separate bounded sink sends them on a
best-effort basis and excludes errors from the diagnostics pipeline itself.
Use docker compose logs vector when VictoriaLogs is unavailable.
Match warn, warning, err, and error in any capitalization with this
LogsQL query.
level:~"(?i)^(warn(ing)?|err(or)?)$"
To also find HTTP 5xx responses across all services, use this query.
level:~"(?i)^(warn(ing)?|err(or)?)$" OR status:range[500,599]
Set SLACK_WEBHOOK_URL in the deployment's .env to the webhook for the
alerts channel. For a Slack Workflow Builder webhook (/triggers/), add a
Text variable named text to the trigger and insert it into the Send a
message to a channel step. Set VICTORIALOGS_URL to the full browser URL
of the VictoriaLogs UI, for example
https://stack.example.org/int/logs/. Recreate the Vector
container with docker compose up -d --force-recreate vector to load both
values. Both values are required to enable notifications.
Vector sends at most one summary per minute with warning and error counts by Compose service and a link to VictoriaLogs. Quiet windows produce no message. Nginx and auth-service HTTP 5xx responses count as errors. Log messages stay in VictoriaLogs. Slack delivery is best effort.
The per-error Slack posts, separate user-feedback Slack notifications, and Matomo error tracking have been retired. Use VictoriaLogs to inspect the underlying log records.
-
Use a Slack test channel webhook in
SLACK_WEBHOOK_URL, setVICTORIALOGS_URL, and recreate Vector as shown above. Keep the middle layer running. -
From the Compose project directory, write one synthetic warning and one synthetic error to the middle-layer container's main stdout. Vector picks them up through its Docker log source.
docker compose exec -T --user 0 impresso-middle-layer sh -c ' timestamp=$(date -u +%Y-%m-%dT%H:%M:%SZ) exec > /proc/1/fd/1 printf "{\"@timestamp\":\"%s\",\"level\":\"WaRn\",\"message\":\"slack-smoke-test warning\",\"logger\":\"app.slack-test\"}\n" "$timestamp" printf "{\"@timestamp\":\"%s\",\"level\":\"eRrOr\",\"message\":\"slack-smoke-test error\",\"logger\":\"app.slack-test\"}\n" "$timestamp" '
-
Allow about a minute for the Slack summary. The
impresso-middle-layercounts should include one warning and one error from the test, plus any real events in the same window. Follow the link in the message and search for_time:10m logger:="app.slack-test"to verify that both records arrived. -
If the records appear but the summary is missing, verify that both variables were loaded and check
docker compose logs --since 5m vectorfor errors fromslack_alerts. If you temporarily changed the webhook, restore its original value and recreate Vector after testing.
The Gatus dashboard is available at /status/ on the Nginx site. It is also
available directly at http://127.0.0.1:8080 on the Docker host. Set
GATUS_PORT to change the direct-access port. Check history is stored in the
gatus-data volume.
Gatus checks both middle layers, Dragonfly, user admin, Celery, Barista,
Meilisearch, auth, annotations, Solr and MySQL. Set GATUS_MONITOR_BARISTA=false
when running without the barista profile to disable the Barista and
Meilisearch checks.
The annotation API defaults to https://impresso-annotation.epfl.ch/api.
Set ANNOTATION_BASE_URL to override it, omitting the trailing slash.
The Solr probe runs a zero-row query against SOLR_CONTENT_ITEM_INDEX using
the existing reader credentials. The MySQL probe connects to DB_DATABASE
with the stack's database credentials and runs SELECT 1.
Compose builds gatus-probes from the dedicated image in gatus/. After
editing the probe code or dependencies, rebuild it with
docker compose up -d --build gatus-probes.
A special note about the database. Our setup assumes the database is accessed via an SSH tunnel to the database host. If the database port is accessible directly, you can simplify the configuration by setting the db hostname, port and credentials in the relevant config files, commenting out the mysql-tunnel section in docker-compose.yml. In this case you also do not need the files in the config/ssh folder, those are used for the DB tunnel only.
Increase the default limit of open files on the host server to increase the maximum allowed number of connections. See socket.io performance tuning.
Tags of impresso docker images are read from the .env file. The default file with all tags set to latest is provided in this repository.
We use Dragonfly instead of Redis as the in-memory data store. The reasons:
- BullMQ / Celery broker — services use BullMQ (Node) and Celery (Python) for job queues, both of which require full Lua scripting support. Redis-compatible alternatives with disk spillover (KVRocks, Pika) have limited Lua support and do not work with BullMQ.
- Disk spillover — Dragonfly supports SSD tiering via
--tiered_prefix, allowing the dataset to exceed available RAM. On Linux hosts withio_uringsupport, cold data is automatically offloaded to disk. On macOS (Docker Desktop), tiering is disabled automatically at startup sinceio_uringis not available. - noeviction — the store is configured with
noevictionso that job queue data and session tokens are never silently dropped. Writes will error if RAM is exhausted rather than losing data.
- Startup script:
scripts/dragonfly-entrypoint.sh— detectsio_uringavailability at runtime and enables/disables tiered storage accordingly. - Max RAM:
2GB. Hourly RDB snapshots are written to thedragonfly-datavolume. --default_lua_flags=allow-undeclared-keysis required for BullMQ compatibility. Dragonfly enforces strict key declaration in Lua scripts by default; BullMQ constructs keys dynamically inside scripts, which trips this restriction. This flag disables the check at a minor performance cost to Lua calls.- On Linux production servers, ensure
io_uringis not disabled (/proc/sys/kernel/io_uring_disabledshould be0) and the container hasseccomp=unconfined(already set indocker-compose.yml) to allow the necessary syscalls.
When building docker container for the app make sure:
- webpack compiles the app with
PUBLIC_PATHenvironmental variable set to/app/(assuming that the app base URL innginxconfiguration is/app). BASE_URLinprod.env.jsis set to'"/app"'(assuming that the app base URL innginxconfiguration is/app).MIDDLELAYER_APIinprod.env.jsis set to'""'MIDDLELAYER_API_PATHinprod.env.jsis set to'"/api"'(assuming that middle layer API base URL innginxconfiguration is/api)MIDDLELAYER_API_SOCKET_PATHinprod.env.jsis set to'"/api/socket.io/"'(assuming that middle layer API base URL innginxconfiguration is/api)MIDDLELAYER_MEDIA_PATHinprod.env.jsis set to'"/api/media"'(assuming that the api base URL innginxconfiguration is/api)