Sign inSign up

minhle202/spring-api

By minhle202

Updated 4 months ago

Minimal Java 21 + Spring Boot REST API — layered jar, non-root, actuator health. Multi-arch.

Image
0

876

minhle202/spring-api repository overview

spring-api

Minimal Java 21 + Spring Boot 3.3 REST API in a small, non-root, multi-arch image.

A clean starting point for a Spring Boot service: real @RestController endpoints, Actuator health checks, and a tuned multi-stage build — not a toy shell.

Pull

docker pull minhle202/spring-api

Run

docker run --rm -p 8080:8080 minhle202/spring-api
curl http://localhost:8080/                       # service info
curl "http://localhost:8080/api/hello?name=Minh"  # greeting
curl http://localhost:8080/actuator/health        # {"status":"UP"}

Endpoints

  • GET / — service info (name, version, endpoint map)
  • GET /api/hello?name= — greeting; name defaults to World
  • GET /actuator/health — Spring Boot Actuator health probe

What's inside

  • Java 21 (Eclipse Temurin) + Spring Boot 3.3 (starter-web + actuator).
  • Multi-stage build: Maven Wrapper builds a Spring Boot layered jar; layers are extracted into a slim eclipse-temurin:21-jre-alpine runtime.
  • Runs as a non-root user with a built-in HEALTHCHECK.
  • Pinned bases, no arch-specific binaries — built for linux/amd64 and linux/arm64.

Configuration

VariableDefaultDescription
SERVER_PORT8080HTTP listen port (also EXPOSEd)
JAVA_OPTSemptyExtra JVM flags, e.g. -Xmx256m
docker run --rm -p 9090:9090 -e SERVER_PORT=9090 \
  -e JAVA_OPTS="-Xmx256m" minhle202/spring-api

Tags

  • latest, 1.0.0 — multi-arch (amd64 / arm64).

Licensed under MIT © Lê Đức Minh. Source includes a README with build and extension notes.

Tag summary

Content type

Image

Digest

sha256:2e26c895b

Size

89.9 MB

Last updated

4 months ago

docker pull minhle202/spring-api