DEV Community

Cover image for Deploying Finovara on Docker and fixing a critical bug.
Marcin Parśniak
Marcin Parśniak

Posted on

Deploying Finovara on Docker and fixing a critical bug.

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

Enter fullscreen mode Exit fullscreen mode

Dockerfile:

FROM eclipse-temurin:21-jdk
WORKDIR /app
COPY target/*.jar app.jar
ENTRYPOINT ["java", "-jar", "app.jar"]
Enter fullscreen mode Exit fullscreen mode

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 .env file
  • 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!

GitHub logo M4rc1nek / finovara-backend

Backend service for a personal finance management application

Finovara

Backend platform for a personal finance management application, built with Java 25 and Spring Boot 4 as a set of microservices.

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, shared accounts and financial reporting.

The platform is built as a set of independent services, each responsible for a separate area of the domain, so that individual parts of the system can be developed, deployed and scaled on their own. Security is a central concern: authentication is based on JWT, sessions are tracked per device, and user activity is recorded in an audit log.


Key Features

Accounts and Security

  • Authentication and Authorization - stateless JWT security built on Spring Security, with an access and refresh token flow.
  • Device and Session Tracking…




Top comments (0)