Files for building and running LogAnalyzer with Docker Compose. Build context is the repository root (parent of this directory). Run commands from the repo root and pass --project-directory . with -f docker/... so Compose loads the repository root .env for variable substitution (otherwise the project directory defaults next to the compose file and ./.env is ignored).
Full guide: Handbook — Docker overview, Docker install, Docker development & CI · contributor notes: AGENTS.md.
- Docker (Engine) and the Compose plugin (
docker compose, v2 syntax). - Clone this repository and open a shell in the repository root (
loganalyzer/, the directory that containsdocker/,src/,README.md).
Recommended for a local “appliance” install: app is baked into the image; MySQL and config.php live in Compose named volumes (loganalyzer_mysql_data, loganalyzer_config).
-
Environment (optional but recommended)
Copyenv.exampleto.envin the repository root (same level asREADME.md, not insidedocker/). Edit admin and database passwords, and any optional flags (see comments inenv.example).
Or run the interactive wizard once:- POSIX:
bash docker/init-env-interactive.sh - Windows:
powershell -File docker\init-env-interactive.ps1 -RepoRoot .
- POSIX:
-
Start the stack
docker compose --project-directory . -f docker/docker-compose.yml up --build -
Open the app
http://localhost:8080/
First-login admin user and password come fromLOGANALYZER_ADMIN_USER/LOGANALYZER_ADMIN_PASSWORDin your.env(Compose defaultsadmin/loganalyzerif unset). -
What you get on first boot
MySQL is initialized; thewebservice generatesconfig.php, waits for the DB, then seeds schema, default views, and the admin user. By default there are no demo disk sources (LOGANALYZER_SEED_SAMPLE_SOURCES=0); enable1in.envif you want the bundled/samplelogssources, or configureLOGANALYZER_DISK_*for real files (below).
Paths in LOGANALYZER_DISK_SOURCE_PATHS / LOGANALYZER_DISK_SOURCES must exist inside the web container. Typical pattern:
- Uncomment the
volumesline underwebindocker-compose.yml(example:- /var/log:/mnt/hostlog:ro). - Set the matching paths in
.env, e.g.LOGANALYZER_DISK_SOURCE_PATHS=/mnt/hostlog/syslog. - First seed only creates those DB sources; changing paths later usually means resetting the
loganalyzer_configvolume and/orLOGANALYZER_OVERWRITE_CONFIG— see the handbook — Docker install.
- Stop without deleting data:
docker compose --project-directory . -f docker/docker-compose.yml down - Wipe DB + persisted config and bring the stack back:
sh docker/rebuild-consumer.shordocker\rebuild-consumer.bat(runs the.envwizard if.envis missing, thendown -vandup --build).
For PHP hacking with the repo src/ mounted into the container and config.php regenerated each start:
docker compose --project-directory . -f docker/docker-compose.dev.yml up --buildMySQL on localhost:3306, wipe helper: docker/rebuild-dev.sh / docker\rebuild-dev.bat. Details: Handbook — Docker development & CI (live src mount).
| Item | Role |
|---|---|
Dockerfile |
Multi-stage image: PHP app + fixtures; copies bootstrap scripts into /usr/local/share/loganalyzer/. |
docker-compose.yml |
Default “consumer” stack: baked app, named volumes for MySQL + config.php. |
docker-compose.dev.yml |
Dev stack: bind-mount src/, overwrite config.php each start. |
docker-compose.e2e.yml |
Playwright CI/local E2E (see e2e/README.md). |
env.example |
Template for repo-root .env: admin, MySQL, optional demo seeding, optional LOGANALYZER_DISK_* disk sources. |
entrypoint.sh |
Container start: write-config, DB wait, seed-database, php -S. |
write-config.php |
Generates config.php from include/config.sample.php + env (incl. DiskAllowed from disk-source env). |
seed-database.php |
First-run MySQL schema/views/admin and optional sources. |
env-disk-sources.php |
Shared helpers for LOGANALYZER_DISK_SOURCE_PATHS / LOGANALYZER_DISK_SOURCES / LOGANALYZER_DISK_ALLOWED_EXTRA. |
init-env-interactive.*, rebuild-*.sh, rebuild-*.bat |
Host-side helpers (handbook » Docker install — helper scripts). |
Published handbook: https://rsyslog.github.io/loganalyzer/docker/ · https://rsyslog.github.io/loganalyzer/docker-install/ (doc-site/docs/docker*.md).