Java app template — z3k platform
Find a file Use this template
Arthur Zinck db311a4994
Some checks failed
build-image / build (push) Failing after 1s
ci: preview build on pull requests
2026-07-27 11:51:40 +00:00
.forgejo/workflows ci: preview build on pull requests 2026-07-27 11:51:40 +00:00
.dockerignore feat: java template — .dockerignore 2026-07-26 20:13:36 +00:00
Dockerfile feat: platform base images (z3k-images) 2026-07-27 07:13:48 +00:00
Main.java feat: java template — Main.java 2026-07-26 20:13:34 +00:00
README.md feat: java template — README.md 2026-07-26 20:13:37 +00:00

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 PORT env var (default 8080).
  • GET /health returns 200 ok — used by the platform's health checks.
  • GET / greets using the APP_NAME env 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.