This repository contains a simple Spring Boot web service packaged with Docker and maintained as a deployment sample for Nife.io.
It is designed as a lightweight example for developers who want to understand how to build a Java web service, package it into a Docker image, run it locally, and deploy it on Nife.io.
This project demonstrates a minimal Spring Boot application that can be built with Maven and containerized with Docker. It is intentionally small and easy to follow, which makes it useful as a reference project for local development, container workflows, and cloud deployment testing.
Before getting started, make sure the following tools are installed on your machine.
| Requirement | Purpose |
|---|---|
| Java | Required to build and run the Spring Boot application |
| Maven | Used to package the application |
| Docker | Used to build and run the container image |
| Git | Used to clone the repository |
Clone the repository and move into the project directory.
git clone https://github.com/nifetency/docker-spring-boot-java-web-service-example.git
cd docker-spring-boot-java-web-service-exampleBuild the application with Maven.
mvn clean installThis command generates the packaged application artifact used in the Docker image build process.
Build the Docker image from the repository root.
docker build -t docker-java-hello-world-app .Run the container and map port 8080 from the container to your local machine.
docker run -p 8080:8080 docker-java-hello-world-appAfter the container starts, you can test the service locally.
curl http://localhost:8080If the application exposes a specific endpoint in your version of the project, you can also test that route directly.
The included Dockerfile packages the built Spring Boot application into a runnable Java container.
| Docker step | Purpose |
|---|---|
| Base image | Provides the Java runtime environment |
| Working directory | Sets the application path inside the container |
| Copy JAR | Adds the packaged application into the image |
| Expose port | Makes the service available on port 8080 |
| Start command | Runs the Spring Boot application with java -jar |
This repository can be used as a simple deployment sample on Nife.io.
To deploy this project, create a new application on Nife.io, connect this GitHub repository, and use the repository Dockerfile as the build method.
| Setting | Suggested value |
|---|---|
| Source | Git Repository |
| Provider | GitHub |
| Repository | nifetency/docker-spring-boot-java-web-service-example |
| Internal Port | 8080 |
| External Port | 80 |
| Build Method | Dockerfile |
For step-by-step deployment guidance, see the Nife.io Quick Deploy documentation.
| Path | Purpose |
|---|---|
src/ |
Spring Boot application source code |
Dockerfile |
Container build instructions |
pom.xml |
Maven configuration and dependencies |
README.md |
Project documentation |
screenshots/ |
Optional screenshots for documentation |
This project is licensed under the MIT License. See the LICENSE file for details.
Copyright (c) 2026 Nife Labs
This project is based on the original docker-spring-boot-java-web-service-example repository by @bzdgn.
This version is maintained by Nifetency and positioned as a sample deployment project for Nife.io.