✨feature : add demo postgres database with Docker and URL inside .env.example#3
Merged
Raumain merged 1 commit intoDec 13, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR updates the local development environment by adding a PostgreSQL 17 container. It also configures the existing bun service to connect to this database, ensuring a complete and integrated development stack.
Key changes include:
Adding a postgres service with health checks and persistent storage.
Updating the existing bun service to load environment variables and wait for the database to be ready.
Type of Change
[ ] Bug fix (non-breaking change that fixes an issue)
[x] New feature (non-breaking change that adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Documentation update
[ ] Performance improvement
[ ] Code refactoring
[ ] Test coverage improvement
Related Issue
N/A
Changes Made
Added postgres service: configured using postgres:17-alpine, including health checks and a pg_data volume for persistence.
Updated bun service:
Added depends_on to ensure the runtime waits for the database to be healthy.
Added env_file to load configuration from .env.
Updated .env: Added database connection strings and credentials for the Docker environment.
Testing
[x] Tested with PostgreSQL version(s): 17-alpine (Docker)
[x] Tested on OS: Docker Desktop (Linux/Mac/Windows)
[x] Ran bun run fmt.check (no errors)
[x] Manual testing performed
[x] All existing features still work
Test Scenarios
Ran docker compose up --build and verified that the new postgres container starts correctly.
Verified that the existing bun container now waits for the postgres health check before starting.
Confirmed that the application (running inside the bun container) can connect to the database using the new environment variables.
Checklist
[x] My code follows the project's coding standards
[x] I have run bun run fmt to format my code
[ ] I have commented complex code sections
[x] I have updated the documentation (if needed)
[x] My changes generate no new warnings or errors
[x] I have tested my changes thoroughly
[x] I have considered backward compatibility
[x] I have updated the README (if needed)
Screenshots (if applicable)
N/A
Breaking Changes
None.
Additional Notes
Ensure that port 5432 is not occupied by another local PostgreSQL instance, or adjust the port mapping in docker-compose.yml if necessary.