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.
| Variable | Required | Effect |
|---|---|---|
LOCAL_ROOT_DIR | yes | the root directory on the computer, mounted as /henniokf. It must be writable for UID 1000 |
LOCAL_PORT | no | the port on the computer, default 3370. If the development server runs alongside, for example LOCAL_PORT=3380 |
HENNIOKF_SYNC_TOKEN | for the first admin | the instance token |
HENNIOKF_URL | no | the main address. Without it passkeys work only at http://localhost:3370 |
COMMIT, BUILT_AT | no | the 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 see | Cause | What helps |
|---|---|---|
| "LOCAL_ROOT_DIR must be set" | the variable is missing in the call | give it at every call |
/status reports that a directory cannot be created | Docker created the missing directory as root | create it before with mkdir -p; the directory then belongs to you |
| the port is taken | the development server runs on 3370 | LOCAL_PORT=3380 |
"not from an image" on /status | without COMMIT in the call | give 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.