Use this guide to create and run an application from this template.
After you create a repository from this template, replace this document with end-user documentation for your repository.
- Create a repository from this template.
- Set the package name, description, URLs, and keywords.
- Replace the sample lifecycle with the application lifecycle.
- Keep each source module focused on one task.
- Add one test file for each source module.
Install Node.js 26 or later and npm 12 or later. Run npm ci from the repository root.
Run node bin/application-template.mjs to start the sample. It loads .env, creates the logger, and registers process error handlers and shutdown signal handlers. It does not open a network listener.
The sample has no required settings. Set LOG_LEVEL to error, warn, info, http, verbose, debug, or silly. The default is info.
The application checks LOG_LEVEL before it creates the logger. If the value is not listed, startup throws a TypeError and does not add process handlers.
Copy .env.example to .env only when local settings are needed. Keep .env out of Git.
The application adds process error handlers and shutdown signal handlers. The shutdown function logs the stop message once. Later calls do not write the message again. Keep shutdown behavior in src/shutdown.mjs and test repeated calls.
Build a local image with docker build -t application-template ..
Template setup — update these values after you create an application repository.
This repository publishes a public starter image on release tags. The image tests GHCR publication and provides a workflow example for template users. It is scaffolding, not a finished application. Do not use it. DevOps may delete it at any time.
The
eliware/application-templatemaintainers own the template image build inputs and platform decision. The workflow leavesplatformsunset, so the build uses theubuntu-latestrunner's platform. The current runner produceslinux/amd64.Use
.github/workflows/ghcr.yamlas a starting point for a derived application's GHCR workflow. Set image visibility and pull access. Set target platforms to the architectures that the derived application supports. Name the owner for build inputs and architecture decisions. Build and publish an image from the derived application repository.
For a derived application, deploy its image with an approved version tag and its recorded SHA-256 digest. Do not deploy the template image. Image publication does not deploy the application. Use the approved deployment process for each derived application.
Run npm test before handoff. It runs tests, lint, formatting, audit, package checks, and profile checks.