https://github.com/zeropsio/recipe-spring
Zerops w/ Spring
https://github.com/zeropsio/recipe-spring
Last synced: 4 months ago
JSON representation
Zerops w/ Spring
- Host: GitHub
- URL: https://github.com/zeropsio/recipe-spring
- Owner: zeropsio
- License: mit
- Created: 2024-07-28T11:40:01.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-28T17:00:45.000Z (almost 2 years ago)
- Last Synced: 2025-12-23T05:50:36.028Z (6 months ago)
- Language: Java
- Size: 20.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Zerops x Spring
[Spring](https://spring.io/) is world's most popular Java framework
designed for building enterprise-level Java applications.
This recipe aims to showcase basic Spring concepts and how to integrate them with [Zerops](https://zerops.io),
all through a simple file upload demo application.

## Deploy on Zerops
You can either click the deploy button to deploy directly on Zerops, or manually copy
the [import yaml](https://github.com/zeropsio/recipe-spring/blob/main/zerops-project-import.yml)
to the import dialog in the Zerops app.
[](https://app.zerops.io/recipe/spring)
## Recipe features
- **Load balanced** Spring web app running on **Zerops Java** service
- Served by production-ready embedded application server **[Tomcat](https://spring.io/)**
- Zerops **PostgreSQL 16** service as database
- Zerops **Object Storage** (S3 compatible) service as file system
- Automatic on-startup Spring **database migrations**
- Utilization of Zerops built-in **environment variables** system
- Logs accessible through Zerops GUI
- **[Mailpit](https://github.com/axllent/mailpit)** as **SMTP mock server**
- **[Adminer](https://www.adminer.org)** for **quick database management** tool
- Unlocked development experience:
- Access to database and mail mock through Zerops project VPN (`zcli vpn up`)
- Prepared `.env.dist` file (`cp .env.dist .env` and change ***** secrets found in Zerops GUI)
## Production vs. development
Base of the recipe is ready for production, the difference comes down to:
- Use highly available version of the PostgreSQL database (change `mode` from `NON_HA` to `HA` in recipe YAML, `db`
service section)
- Use at least two containers for Spring service to achieve high reliability and resilience (add `minContainers: 2` in
recipe YAML, `api` service section)
- Use production-ready third-party SMTP server instead of Mailpit (change `MAIL_` secret variables in recipe YAML `api`
service)
- Disable public access to Adminer or remove it altogether (remove service `adminer` from recipe YAML)
## Changes made over the default installation
If you want to modify your existing Spring app to efficiently run on Zerops, these are the general steps we took:
- Add [zerops.yml](https://github.com/zeropsio/recipe-spring/blob/main/zerops.yml) to your repository, our example
includes migrations and build process
Need help setting your project up? Join [Zerops Discord community](https://discord.com/invite/WDvCZ54).