Spaces:
Sleeping
Sleeping
|
Download README.md from amritnray/simple-java-app: direct link, hf CLI and curl.
- Browser
- Download file 2.68 kB
-
https://huggingface.co/spaces/amritnray/simple-java-app/resolve/main/README.md
- Command line
-
hf download hf://spaces/amritnray/simple-java-app/README.md
-
curl -L -o README.md https://huggingface.co/spaces/amritnray/simple-java-app/resolve/main/README.md
2.68 kB
metadata
title: SimpleJavaApp
emoji: π
colorFrom: blue
colorTo: green
sdk: docker
app_port: 8080
pinned: false
SimpleJavaApp π
A modern and production-ready Spring Boot application containerized for easy, free cloud deployment (Render, Koyeb, OCI) .
This project features a fully configured Student Management Service and comes out of the box with Docker multi-stage build optimization and automated JVM memory tuning specifically designed to prevent Out of Memory (OOM) errors on restricted free-tier hosting platforms.
π Key Features
- Spring Boot Core: Web, JPA, H2 In-Memory database, and custom library starter support.
- REST APIs: Full CRUD capabilities for student resource management.
- Self-Contained Dependency Management: Houses the custom
spring-boot-mcp-starterlibrary locally in/libsso that the cloud build compiles flawlessly without external repositories. - Cloud-Optimized Dockerfile: Uses a multi-stage
eclipse-temurinAlpine Docker image to produce a ultra-lightweight running container. - Smart JVM Memory Constraints: Automatically restricts JVM heap space to
75%of container memory to survive restricted hosting tiers.
π οΈ How to Run Locally
Prerequisites
- Java SDK: Version 21
- Gradle: Handled automatically via
./gradlew
Run from Terminal
Clone the repository and run:
# Run the application
./gradlew bootRun
The application will start on http://localhost:8080.
βοΈ How to Deploy Free on the Cloud (Render)
This application is ready to deploy to Render with a single click.
- Push your code to GitHub: Create a repository and push this project directory.
- Log into Render: Connect using your GitHub account at Render Dashboard.
- Create a New Web Service:
- Click New + > Web Service.
- Select your
SimpleJavaApprepository.
- Configure Settings:
- Runtime:
Docker - Instance Type:
Free
- Runtime:
- Launch: Click Create Web Service.
Render will automatically read the Dockerfile, package the local libraries, compile your source code, and serve it live!
π Project Structure
βββ libs/ # Local jar dependencies (spring-boot-mcp-starter)
βββ src/ # Application source code
β βββ main/java/com/... # Spring controllers, services, repositories
βββ Dockerfile # High-efficiency multi-stage Docker build
βββ build.gradle # Build and dependency configuration
βββ README.md # Project documentation