Skip to content

Rebuilding openLogForge Docker container

This guide covers how to rebuild an existing Docker Compose deployment of openLogForge from scratch.

Back up your data before updating

Always create a database backup before pulling a new version. See Step 1 below.


Step 1 - Back up the database

The database lives inside a Docker named volume (olf-data). Export a copy to the host before making any changes.

# Create a backup directory if it does not exist
mkdir -p ~/openlogforge-backups

# Copy the database out of the running container
docker compose exec app sh -c "cp /data/openlogforge.db /tmp/openlogforge-backup.db"
docker compose cp app:/tmp/openlogforge-backup.db \
  ~/openlogforge-backups/openlogforge-$(date +%Y%m%d-%H%M%S).db

echo "Backup saved to ~/openlogforge-backups/"
ls -lh ~/openlogforge-backups/

Step 2 - Check the current version

git -C /path/to/openlogforge describe --tags --abbrev=0

Note the current version tag so you can roll back to it if needed.


Step 3 - Rebuilding procedure

Stop containers, remove the olf-data volume (drops openlogforge.db):

docker compose down -v

Rebuild docker images ignoring Docker layer cache:

docker compose build --no-cache

Check CHANGELOG.md for breaking changes or manual migration steps:

git diff ORIG_HEAD..HEAD -- CHANGELOG.md

Step 4 - Start container

docker compose up --build

Docker rebuilds both images, stops the old containers, and starts the new ones. Alembic database migrations run automatically during backend startup before the API becomes available.


Step 5 - Verify the rebuild

Check both containers are running:

docker compose ps

Expected output:

NAME                     IMAGE               STATUS          PORTS
openlogforge-app-1       openlogforge-app    Up              8000/tcp
openlogforge-web-1       openlogforge-web    Up              0.0.0.0:80->8080/tcp

Check the backend logs for migration output and a clean start:

docker compose logs app --tail 30

Look for lines similar to:

INFO  [alembic.runtime.migration] Running upgrade ...
INFO:     Application startup complete.

Confirm the web interface loads correctly in your browser.