Java app template — z3k platform
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| .dockerignore | ||
| Dockerfile | ||
| Main.java | ||
| README.md | ||
Java app template
A minimal Java 21 web app for the z3k platform — a single Main.java using the
JDK's built-in HTTP server, no Maven or Gradle. The Dockerfile compiles it with
javac.
How it works
- Listens on the
PORTenv var (default8080). GET /healthreturns200 ok— used by the platform's health checks.GET /greets using theAPP_NAMEenv var.- Environment variables come from the console's Configuration tab.
Deploy
Edit Main.java, commit, and push to main — the platform builds the image
and rolls out your app automatically.
Going further
Prefer Spring Boot, Quarkus, or another framework? Any Java app works — it just
needs its own Dockerfile that builds the app and listens on PORT.