This project can be run with Docker or Podman. This guide assumes Podman. If you use Docker, replace podman with
docker in the commands below.
The following runtime environment is recommended:
| Environment | Notes |
|---|---|
| Docker / Podman | Container runtime |
| Docker Compose | Compose engine |
| JDK 25 (optional) | Required only if developing the backend |
Environment variables are defined in the .env file at the repository root.
Copy the template file.
cp .env.template .envAnd then update the values according to your local environment.
Important
JWT_SECRET must be configured manually, as the template doesn't provide a default value.
The application will not start if it is empty.
If you don't have a secure JWT secret, here are examples for generating a secure Base64 value:
Linux/Mac OS
openssl rand -base64 32or
head -c 32 /dev/urandom | base64Windows Powershell
[Convert]::ToBase64String((1..32 | ForEach-Object { Get-Random -Maximum 256 }))First, configure the IDE to load environment variables.
Tip
Here is a way to load environment variables in IntelliJ IDEA.
- Open the run widget's menu. From the menu, select Edit Configurations.
- Enable the Environment Variables option;
- Click the Browse for .env files and scripts icon (a folder), then select the
.envfile created before.
Then, start the backend from IDE, Spring Boot Docker Compose would start the required containers automatically.
Important
Spring Boot Docker Compose is designed for Docker.
To use it with Podman, you may need to install docker-compose, map the socket file, and install podman-docker to
emulate the Docker CLI.
For more information, see Troubleshooting.
If Podman does not work for you, or if you prefer to start the services manually, you can follow the following steps alternatively:
-
Open
backend/src/main/resources/application.yaml; -
Set
spring.docker.compose.enabledtofalse; -
Run the following command from the project root to start the infrastructure services (Postgres and Redis).
podman compose upFor local Redis testing from the host, the service is exposed on ${REDIS_EXTERNAL_PORT}.
You can verify connectivity with:
redis-cli -p "$REDIS_EXTERNAL_PORT" pingFirst, run the Gradle build from the project root;
./gradlew :backend:bootJarConfirm that the generated JAR exists in backend/build/libs. If it does, run the following command to start compose
from the project root.
podman compose -f compose.yaml -f compose.override.yaml upThis command builds an image from backend/Dockerfile, copies the JAR into the container, and starts the application.
Warning
The default Dockerfile uses a Docker Hardened Image (DHI) as the Java runtime, so authentication is required.
- If you have credentials, log in to
dhi.orgbefore running the command; - If that fails, modify the
FROMinstruction inbackend/Dockerfileto use a public JRE image.
CI-tested images have been published on GitHub Packages. Just run the command below. Compose will pull the required image and deploy it automatically.
podman compose -f compose.yaml -f compose.prod.yaml upSpring Boot Docker Compose support expects a Docker-compatible CLI. When using Podman, the application may fail to start with an error similar to:
Cannot run program "docker"
This happens because Spring Boot invokes the docker command directly.
A possible solution is to install a Docker-compatible wrapper and enable the Podman socket.
Tip
Here is a way to do so with Fedora.
# Install a Docker-compatible CLI and a Compose engine
# Spring Boot Docker Compose invokes the `docker` command directly
sudo dnf install podman-docker docker-compose
# Enable the Podman API socket so Docker-compatible clients can connect
systemctl --user enable --now podman.socket
# Tell Docker-compatible tools to use the Podman socket
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/$UID/podman/podman.sockIf the backend is run from IntelliJ IDEA on Windows while the project is stored in WSL2, the following errors may appear:
JMX connector server communication errorPort already in use(random high port)
This is usually caused by IntelliJ IDEA’s remote JMX agent port rather than your application server port.
Recommended workaround for local development:
- Open the Spring Boot run configuration;
- Enable
Disable JMX endpoints; - Add VM option:
-Dspring.jmx.enabled=false; - Run the backend.
When troubleshooting, check both WSL2 and Windows, since the port may be in use on either side:
In WSL2:
ss -tunlp | grep <PORT>
ps -ef | grep javaIn Windows PowerShell:
Get-NetTCPConnection -LocalPort <PORT> | Select-Object ProcessId, State
tasklist /FI "PID eq <PID>"