Files
coreapp-dev/templates/app/README.md
T
davidandClaude Opus 5.5 1108060432 coreapp: make, deploy and test apps on the Core in the VM
Apps are folders in Federated Core's generic services format (service,
docker-compose.yml.in, env.in, install, uninstall, icon.png) plus their
own Dockerfile. coreapp new scaffolds one from templates/app with an
address in 192.168.200.x; deploy builds the image, copies it to the Core
over SSH, installs it with installapp (and starts it, since the Core's
start only knows its own apps) or updates it keeping .env; check, status,
logs, shell and remove work on the Core.

Apps in development aren't registered with Federated's monitoring: deploy
drops MONITOR from the Core's copy of service. installapp/uninstallapp
traces go to private logs, not the terminal.

update.sh installs docker and docker-buildx and links coreapp into
~/.local/bin. PLAN.md: how the Core runs apps, and corrected evidence for
the Core's timers running their jobs at every boot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 11:54:25 -07:00

46 lines
1.9 KiB
Markdown

# {{TITLE}}
An app for Federated Core, made with
[coreapp-dev](https://gitea.federated.computer/Federated_Computer/coreapp-dev).
## Develop
Change the app (`Dockerfile`, `www/`), then, in this folder:
```
coreapp deploy # build the image, copy it to the Core in your VM, install or update
coreapp check # https://{{NAME}}.<domain>/ answers, with a valid certificate
coreapp logs -f # its log
coreapp status # its container, address and URL
coreapp shell # a shell in its container
coreapp remove # uninstall it from the Core
```
## Files
The app is in the format Federated Core installs apps from
(`/federated/services/{{NAME}}/` on the Core):
| File | What it is |
|---|---|
| `service` | Name, description, image (`CONTAINER`), `VERSION`, `INTERNAL_IP`, apps it needs (`DEPENDS`, e.g. `postgresql`), and how to check it's up (`MONITOR`) |
| `docker-compose.yml.in` | The container(s), on the Core's `core` network at `INTERNAL_IP`, with the traefik labels that give it `https://{{NAME}}.<domain>` |
| `env.in` | Its settings, as the `.env` file next to the compose file |
| `install` | Run by the Core's `installapp`; fills in the templates |
| `icon.png` | Its icon in the Core's dashboard |
| `Dockerfile`, `www/` | The app itself (not copied to the Core) |
In `docker-compose.yml.in` and `env.in`, the Core replaces, once at install:
- `@DOMAIN@`: the Core's domain, and any other variable in `/etc/federated`
- `@VERSION@`, `@CONTAINER@`, `@INTERNAL_IP@`: from `service`
- `@SECRET:RANDOM:LLLLLLLL@`: a random value (`L` a letter or digit, `a`
lowercase, `A` uppercase, `0` a digit, `x` hex), also available as
`@SECRET@` further down
`${...}` is left for Docker Compose, which reads it from `.env`.
Raise `VERSION` in `service` for each release. The Core's nightly upgrade
only redeploys an app when `VERSION` differs from `IMAGE_VERSION` in its
`.env`.