Skip to content

Feature/130 add db to docker#141

Closed
XtophB wants to merge 4 commits into
mainfrom
feature/130-add-db-to-docker
Closed

Feature/130 add db to docker#141
XtophB wants to merge 4 commits into
mainfrom
feature/130-add-db-to-docker

Conversation

@XtophB
Copy link
Copy Markdown
Collaborator

@XtophB XtophB commented May 25, 2026

Context

This PR adds a PostgreSQL database to the docker compose file. This allows us to deploy the game with a DB in the future.

Description

  • Add postgres 16 to docker
  • Add volume for persistent storage even when container lifecycle ends
  • Container will now only start when DB is live
  • Add H2 database as a temporary solution for future branches while working on DB creation for persistence. We now have a temporary mock DB in memory for every test suit run.

Changes in the code base

  • pom file now contains new dependencies
  • docker compose file updated to include databse
  • application.yaml creates a localhost database when we run application in IDE
    • This is overwritten when we deploy and containerize as docker compose injects the env postgres url into localhost url
  • We now have in memory database for tests.

Changes outside the code base

N/A

Additional information

N/A

XtophB added 4 commits May 23, 2026 11:54
Backend service will now only start if postgres service has successfully started
Allows @SpringBootTest to run without problem in the future while actual DB is not present.
@sonarqubecloud
Copy link
Copy Markdown

@XtophB XtophB marked this pull request as draft May 25, 2026 19:15
@XtophB XtophB closed this May 25, 2026
@XtophB
Copy link
Copy Markdown
Collaborator Author

XtophB commented May 25, 2026

Original plan:

docker db -> dev
docker db -> main

It makes more sense to do:

docker db -> dev
dev -> main

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.

1 participant