HenniOKF
Documentation

Guide

Compose locally

Building the image on your own computer and starting it with docker/compose.local.yml.

What it is about

docker/compose.local.yml builds the image from your working tree and starts it on your computer. So you try what will run on the VPS, without the registry. Call it from the root of the project.

Starting

Once in the shell, create the root directory and set the two values. Without TMPDIR take another directory.

export LOCAL_ROOT_DIR="$TMPDIR/henniokf" && mkdir -p "$LOCAL_ROOT_DIR"
export HENNIOKF_SYNC_TOKEN="$(openssl rand -hex 32)" && echo "$HENNIOKF_SYNC_TOKEN"

You need the printed token in a moment for the first admin. Then build and start:

docker compose -f docker/compose.local.yml up -d --build

Afterwards the application answers at http://localhost:3370. If you start npm run dev in the same shell, the exported token applies there too, because a set variable goes before .env.local.

VariableRequiredEffect
LOCAL_ROOT_DIRyesthe root directory on the computer, mounted as /henniokf. It must be writable for UID 1000
LOCAL_PORTnothe port on the computer, default 3370. If the development server runs alongside, for example LOCAL_PORT=3380
HENNIOKF_SYNC_TOKENfor the first adminthe instance token
HENNIOKF_URLnothe main address. Without it passkeys work only at http://localhost:3370
COMMIT, BUILT_ATnothe version for /status. Compose does not know Git

With the version:

COMMIT="$(git rev-parse --short HEAD)" docker compose -f docker/compose.local.yml up -d --build

Looking and stopping

The file requires LOCAL_ROOT_DIR at every call, also for logs and down. Without the variable Compose stops while reading. In a new shell you set it again.

docker compose -f docker/compose.local.yml logs --tail 50
docker compose -f docker/compose.local.yml down

The project is called henniokf (name: in the file); otherwise it would be called "docker" after the directory of the file. build.context is .., because it counts relative to the file.

What can go wrong

What you seeCauseWhat helps
"LOCAL_ROOT_DIR must be set"the variable is missing in the callgive it at every call
/status reports that a directory cannot be createdDocker created the missing directory as rootcreate it before with mkdir -p; the directory then belongs to you
the port is takenthe development server runs on 3370LOCAL_PORT=3380
"not from an image" on /statuswithout COMMIT in the callgive COMMIT or build with docker/build.sh

On Linux the directory belongs to UID 1000 only if your user has that UID. Otherwise sudo chown 1000:1000 <path>.

Next: On a VPS with Traefik.