I recently decided to move my Spring Boot app Finovara to Docker.
At first it was just supposed to be a small improvement to the setup.
In reality, it turned into a debugging session that took way longer than I expected.
Why I even bothered with Docker
There were a few reasons behind this:
- I wanted more control over the environment
- I needed a separate database (
finovara-test) for automated tests - I was tired of manually setting everything up locally
- and I wanted something closer to a real production setup
Initial setup
I started with a simple PostgreSQL container and connected my app to it.
Here’s a simplified version of what I used:
services:
finovara-db:
image: postgres:15
container_name: finovara-db
restart: always
environment:
POSTGRES_DB: finovara
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${DB_PASSWORD}
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
retries: 10
Dockerfile:
FROM eclipse-temurin:21-jdk
WORKDIR /app
COPY target/*.jar app.jar
ENTRYPOINT ["java", "-jar", "app.jar"]
Everything started without issues.
Database was running, app connected, no errors.
So I thought I was done.
The moment things got weird
I made some changes in the app, rebuilt everything, ran it again and nothing changed.
- same responses
- same data
- same behavior
At this point I was pretty sure I messed something up.
What I thought vs what it actually was
My first guess was Docker caching.
Seemed like the obvious explanation.
But after digging a bit more, it turned out to be something else entirely.
The app was connecting to a completely different database than I expected.
Everything looked correct:
- same DB name
- same user
- same config
So from the outside it looked like everything was fine, but I was basically working on one database and checking another.
Fixing it
The fix wasn’t one single thing, more like a combination of small adjustments:
- I changed the password in my
.envfile - I changed the port, because something else was already using 5432
- I cleaned up and adjusted the docker-compose config
- and most importantly, I actually verified which database the app connects to
After that, everything finally made sense again and changes started showing up immediately.
Thanks for reading and visit my github!
M4rc1nek
/
finovara-backend
Backend service for a personal finance management application
💰 Finovara — Backend
Backend REST API for a personal finance management application built with Java 25 and Spring Boot 4.
📖 About the Project
Finovara is a personal finance platform designed to help users take full control of their money. The backend exposes a secure REST API that powers tracking of income and expenses, budget management, savings goals, and financial reporting — all wrapped in a bank-grade security model based on JWT authentication.
The application is designed with scalability in mind and is fully containerized via Docker, with separate production and test database environments managed through Docker Compose.
🎯 Key Features
- 🔐 Authentication & Authorization — JWT-based stateless security with Spring Security; access and refresh token flow with device/user-agent detection
- 💸 Income & Expense Tracking — full CRUD for financial operations with category tagging
- 📊 Statistics & Reports — aggregated financial summaries, spending trends, and exportable PDF reports
- 🏦…
Top comments (0)