Deployment
Pre-built images are available on the Docker Hub.
Dolog learns about your containers by reading from the Docker socket, which has to be mounted into the Dolog container. You can verify it starts correctly via the following command:
docker run --rm \
-p 3000:3000 \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
butterhosting/dologA more realistic setup mounts a local directory at /opt/dolog/data, so the SQLite database holding your logs survives container restarts:
services:
dolog:
image: butterhosting/dolog
restart: unless-stopped
ports:
- "3000:3000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./.htpasswd:/opt/dolog/.htpasswd:ro
- /host-data/dolog:/opt/dolog/data
environment:
DOLOG_TIMEZONE: "Europe/Amsterdam"
DOLOG_RETENTION_TIME_WINDOW: "30d"Environment vars
When starting Dolog, the following environment variables can be specified.
| Variable | Options | Description |
|---|---|---|
DOLOG_LOGGING | debug, info, warn, error (default info) | Specifies Dolog's own logging level |
DOLOG_TIMEZONE | IANA time zone (default UTC) | Specifies the timezone in which timestamps are shown |
DOLOG_WEBHOOKS | optional | Specifies named webhooks used for alerting as whitespace-separated name=https://url.com pairs; outgoing requests will authenticate themselves by specifying name=https://user:pass@url.com URLs |
DOLOG_SUPPORT_TOKEN | optional | Specifies a Dolog support token; click here for more information |
The remaining environment variables define Dolog's policies for retention, throttling and alerting. These are described in the Configuration section, since each of them can also be set for a single container through a Docker label.
.htpasswd
Dolog supports HTTP Basic Authentication out of the box. To enable it, place a passwords file at /opt/dolog/.htpasswd using the standard Apache format with bcrypt hashes.
alice:$2b$10$0EhE06AyBn4shMGqCkJzqOIPGsYCJxO2mzbgCbfFQ4te5003PiYOK
bob:$2b$10$LbAfTfDmhD9SbroH.JVrc.uUpfNxVDDtjPDTvwE7UaCNnn3PxrQF2Which can be created as follows:
htpasswd -B -c .htpasswd aliceIf no passwords file is present, authentication is disabled. For any deployment exposed to the internet, you should either provide an .htpasswd or place Dolog behind a reverse proxy that handles it.
/data/
The /opt/dolog/data/ directory stores Dolog's internal SQLite database, containing all container logs.
Losing the data/ directory means losing your log history, which may be acceptable. Otherwise, consider mounting /opt/dolog/data/ as a persistent volume.
Backups
Make sure the /data/ directory mentioned above is mounted as a host directory, for example -v /host-data/dolog:/opt/dolog/data. Backups are then straightforward:
- Stop the Dolog container
- Copy the entire data directory to your backup destination, for example
rsync -a /host-data/dolog/ /host-backups/dolog/ - Start the Dolog container
Restores are the same steps in reverse:
- Stop the Dolog container
- Replace the entire data directory with the backup, for example
rsync -a --delete /host-backups/dolog/ /host-data/dolog/ - Start the Dolog container
Two things matter in both directions: Dolog must stay offline for as long as the copy runs, and the /data/ directory is always copied or replaced in its entirety. Previous backups must be restored into the same or a newer version of Dolog.