Skip to content
Maria Martinez edited this page Sep 18, 2026 · 1 revision

Docker Compose Setup for Infrastructure Services

This document provides instructions on how to set up and run the infrastructure services supporting local development using Docker Compose. The services included are PostgreSQL, Oracle Database, and the automated Flyway migration service.


Prerequisites

Before starting, ensure you have one of the following container runtimes installed on your machine:


Infrastructure Services Defined

The root docker-compose.yml file defines three foundational infrastructure services:

1. PostgreSQL Database (database)

  • Container: database
  • Port: 5432
  • Default Credentials: user: postgres, password: default, database: postgres
  • Context: Built from database/Dockerfile based on postgres:13.23.
  • Health Check: Utilizes pg_isready -U postgres to verify readiness.
  • Data Persistence: Mounts /pgdata volume to persist state across container restarts.

2. Oracle Legacy Database (legacydb)

  • Container: oracle
  • Port: 1521
  • Image: gvenzl/oracle-free:23.9-full-faststart
  • Credentials: user: THE, password: default, service: FREEPDB1
  • Health Check: Uses containerized healthcheck.sh.

3. Flyway Oracle Migration Service (legacyflyway)

  • Container: flyway
  • Image: flyway/flyway
  • Action: Connects to the healthy Oracle database via JDBC (jdbc:oracle:thin:@legacydb:1521/FREEPDB1) and executes all SQL migration scripts mounted from legacy/src/test/resources/db/migration.
  • Execution: Runs once upon startup and automatically shuts down once migrations finish.

Starting the Infrastructure

Run the following command from the root of the repository:

docker compose up -d database legacydb legacyflyway

(If using Podman, execute podman-compose up -d database legacydb legacyflyway)

To check container health and progress:

docker compose ps
docker compose logs -f legacyflyway

Local Customizations & Overrides

Using .env Files

Docker Compose automatically loads environment variables from a .env file located in the root directory. You can specify custom ports or resource limits without modifying docker-compose.yml:

POSTGRES_PORT=5432
ORACLE_PORT=1521

Using docker-compose.override.yml

For machine-specific volume mounts or port mappings, create a docker-compose.override.yml file in the root directory. Docker Compose merges this file automatically:

services:
  database:
    ports:
      - "5433:5432" # Example: remap PostgreSQL port if 5432 is in use locally

Note

Both .env and docker-compose.override.yml are included in .gitignore to prevent committing developer-specific configurations or credentials.

Clone this wiki locally