Java Basic Webserver
Spring Boot server with health endpoint and Docker support
A minimal Spring Boot web server with health check endpoints via Actuator. Includes Docker multi-stage build, Kubernetes deployment manifests, and GitHub Actions CI/CD workflow.
terchrisPrerequisites
Files
Files (10)
├── .dockerignore ├── .gitignore ├── Dockerfile ├── pom.xml ├── README-java-basic-webserver.md ├── template-info.yaml ├── .github/ │ └── workflows/ │ └── urbalurba-build-and-push.yaml ├── app/ │ └── src/ │ └── main/ │ └── java/ │ └── com/ │ └── example/ │ └── App.java └── manifests/ ├── deployment.yaml └── kustomization.yaml
Related templates
①What gets set up
When you install this template, the following are configured for you:
- Installs Java JDK, Maven, Gradle, and VS Code extensions for Java development.
②Run the Spring Boot app
mvn spring-boot:runSpring Boot runs on port 3000. VS Code auto-forwards the port.
Architecture
These diagrams are auto-generated from the template's metadata. Click any diagram to enlarge.
Deployment
Components
Template README
The Java Basic Webserver template is a simple hello world app built with Spring Boot that displays "Hello world" on a web page. The purpose of this simple app is to verify that the development environment is set up and ready. See more documentation at http://localhost:3000/docs/templates/basic-web-server/java-basic-webserver
HTTP API
| Path | Method | Response |
|---|---|---|
/ | GET | Plain text: greeting, template id java-basic-webserver, and formatted time/date |
Spring Boot Actuator is on the classpath (spring-boot-starter-actuator). Typical health URL: GET /actuator/health (Spring Boot defaults; no application.properties is shipped in this template).
Entry point and port
- Main class:
com.example.App - Port: Spring Boot’s default is 8080 unless you set
server.port. The Dockerfile and Kubernetes manifests in this template use 3000 — addapp/src/main/resources/application.propertieswithserver.port=3000, or pass--server.port=3000, to match the container locally. - Run (after build):
mvn clean packagethenjava -jar target/*.jar
Changing the app
- Add
@GetMapping/@RestControllermethods inApp.javaor split into additional controllers undercom.example.