Spring Boot API for managing mugs, packaged for Docker and Raspberry Pi deployment.
Build the image:
docker build -t mugs:latest .Run it with a persistent SQLite volume:
docker run -d \
--name mugs \
-p 8080:8080 \
-e SPRING_DATASOURCE_URL=jdbc:sqlite:/data/mugs.db \
-e SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUER_URI=https://jrtcojpgdubbmgsmnhgs.supabase.co/auth/v1 \
-e APP_SECURITY_JWT_AUDIENCE=authenticated \
-v mugs-data:/data \
--restart unless-stopped \
mugs:latestStart the app with Compose:
docker compose up -d --buildThe SQLite database is stored in the mugs-data Docker volume at /data/mugs.db.
This repository is configured to publish Docker images to GitHub Container Registry (GHCR) from GitHub Actions.
Published images use the name:
ghcr.io/<your-github-organization-or-user>/mugs
Typical tags include:
latestfor the default branch- the branch name for branch builds
- the Git commit SHA for traceability
- release tags like
v1.2.3
To run the published image on a Raspberry Pi:
docker run -d \
--name mugs \
-p 8080:8080 \
-e SPRING_DATASOURCE_URL=jdbc:sqlite:/data/mugs.db \
-e SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUER_URI=https://jrtcojpgdubbmgsmnhgs.supabase.co/auth/v1 \
-e APP_SECURITY_JWT_AUDIENCE=authenticated \
-v mugs-data:/data \
--restart unless-stopped \
ghcr.io/<your-github-organization-or-user>/mugs:latest- Use a Raspberry Pi OS image with Docker installed.
- The Dockerfile uses multi-arch base images, so it can run on common Raspberry Pi ARM variants.
- If you build on another machine and want to target the Pi explicitly, use Docker Buildx:
docker buildx build --platform linux/arm64 -t ghcr.io/<your-github-organization-or-user>/mugs:latest --push .- If you want to publish manually to GHCR, keep the image name in the
ghcr.io/<owner>/mugsnamespace.
Environment variables you may want to set in production:
SPRING_DATASOURCE_URL— defaults tojdbc:sqlite:/data/mugs.dbSPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUER_URI— Supabase or other JWT issuerAPP_SECURITY_JWT_AUDIENCE— expected JWT audienceSERVER_PORT— HTTP port, defaults to8080
The API contract is defined in api-specification.yml. This file drives both generated Java models and Swagger UI documentation.
- The generated Java models are written to
build/generated/openapi/src/main/java/com/overmild/mugs/models. compileJavarunsopenApiGenerateautomatically, so a normal build always regenerates models from the spec.- The same
api-specification.ymlis copied into app static resources at build time and served at/api-specification.ymlfor Swagger UI.
You can run generation directly with:
./gradlew openApiGenerate