Add a Makefile so a fresh clone can be running in one call #153
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
qwc-open/asiakirjat!153
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/makefile-quickstart"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
There was no fast path from clone to something you can log into. The pieces existed — Dockerfile, compose file, config example — but stitching them together meant knowing three things written down nowhere:
docker-compose.ymlmounts./config.yamlread-only, and that file doesn't exist in a fresh clone;admin, which the server refuses to create an account with, so a first run fails with a password-strength message instead of starting;ASIAKIRJAT_env override and a missing config file falls back to defaults — so a playground needs no config file at all.The headline
Builds the image, runs it, waits for
/healthz, and prints:make helplists everything; any variable overrides (make demo PORT=9000).Decisions worth reviewing
.demo-password(gitignored, 0600). The admin account is created only on a container's first start, so regenerating it each run would print credentials that stopped working after the firstmake demo.stop→demokeeps it andresetdeliberately doesn't.asiakirjat:local, not by version — it's rebuilt constantly and versioned tags would leave a pile behind.VERSIONis still stamped into the binary via ldflags.make config+make compose-upkeep the config-file path for when you do want to edit one.What I verified, and what I didn't
Verified:
build,help,config,clean, and — the one the demo actually rests on — that the binary starts with no config file present, from env alone, and puts its database and projects under./data, which is what the container mounts as its volume.That check also caught a bug in this Makefile:
runusedASIAKIRJAT_PORT, but the real variable isASIAKIRJAT_SERVER_PORT, soPORT=was being silently ignored. Fixed.Not verified: the Docker targets themselves — there is no Docker in this environment.
make -n demoexpands correctly, butdocker build/docker runhave not actually been executed. Worth one manualmake demobefore merging.Assisted-by: Claude Opus 5
There was no fast path from clone to something you can log into. The pieces existed — a Dockerfile, a compose file, a config example — but stitching them together meant knowing three things that are not written down anywhere: - docker-compose.yml mounts ./config.yaml read-only, and that file does not exist in a fresh clone; - the shipped example's admin password is "admin", which the server refuses to create an account with, so a first run fails with a message about password strength rather than starting; - every setting has an ASIAKIRJAT_ environment override, and a missing config file falls back to defaults, so a playground needs no config file at all. `make demo` builds the image, runs it, waits for /healthz, and prints the URL and the credentials it generated. make logs / stop / reset cover the rest. The generated admin password is written to .demo-password and kept, because the admin account is only created on a container's first start: a fresh password each run would print credentials that stopped working after the first one. The demo's data lives in a named volume, so stop and demo round-trips keep it and reset deliberately does not. The image is tagged asiakirjat:local rather than by version — it is rebuilt constantly and versioned tags would leave a pile behind. VERSION is still stamped into the binary. make config and make compose-up keep the config-file path for when you do want to edit one. Verified: build, help, config and the env-only startup the demo relies on — the binary comes up with no config file present and puts its database and projects under ./data, which is what the container mounts. The docker targets themselves are unverified: there is no Docker in this environment. Assisted-by: Claude Opus 5 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Marcel M. Otte <marcel.otte@mmo.to>