Skip to content

Add PostgreSQL Docker Compose service - #7

Merged
DataTideHH merged 1 commit into
mainfrom
agent/add-docker-compose
Aug 5, 2026
Merged

Add PostgreSQL Docker Compose service#7
DataTideHH merged 1 commit into
mainfrom
agent/add-docker-compose

Conversation

@DataTideHH

Copy link
Copy Markdown
Owner

What changed

  • add a root-level compose.yaml
  • run PostgreSQL 18 in an Alpine-based container
  • expose PostgreSQL on port 5432
  • persist database data in a named volume
  • add a readiness health check with pg_isready

Scope

This change only adds the local PostgreSQL service. The Spring Boot application configuration remains unchanged and continues to use H2 until profiles and PostgreSQL wiring are introduced separately.

Validation

  • Compose file structure reviewed against the PostgreSQL container interface
  • existing application build remains unaffected because no Java or Maven files changed

Copilot AI lite review requested due to automatic review settings August 5, 2026 21:28
@DataTideHH
DataTideHH merged commit 0b2ca70 into main Aug 5, 2026
2 checks passed
@DataTideHH
DataTideHH deleted the agent/add-docker-compose branch August 5, 2026 21:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a root-level Docker Compose configuration to run a local PostgreSQL instance for development, without changing the Spring Boot app’s current default H2 setup.

Changes:

  • Introduces compose.yaml defining a postgres service using postgres:18-alpine.
  • Exposes PostgreSQL on port 5432 and persists data via a named volume.
  • Adds a container healthcheck using pg_isready.
Suppressed comments (1)

compose.yaml:9

  • Port mapping binds PostgreSQL to all network interfaces. For a local-only dev database, bind to localhost to reduce accidental exposure on shared networks.
    ports:
      - "5432:5432"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread compose.yaml
Comment on lines +12 to +16
healthcheck:
test: ["CMD-SHELL", "pg_isready -U processapp -d processdb"]
interval: 5s
timeout: 5s
retries: 10
Comment thread compose.yaml
Comment on lines +4 to +7
environment:
POSTGRES_DB: processdb
POSTGRES_USER: processapp
POSTGRES_PASSWORD: processapp

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 55b43ff691

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread compose.yaml
ports:
- "5432:5432"
volumes:
- processdb-data:/var/lib/postgresql/data

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mount the Postgres 18 volume at the new data root

Because this service uses postgres:18-alpine, the official image docs place the live PGDATA under /var/lib/postgresql/18/docker and recommend targeting the volume at /var/lib/postgresql; mounting the named volume at the old /var/lib/postgresql/data path can leave the actual database files in an anonymous parent volume, so data disappears after a docker compose down/container recreation even though processdb-data exists. Please mount processdb-data at /var/lib/postgresql (or explicitly set PGDATA inside the mounted path) instead.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants