Skip to content

✨feature : add demo postgres database with Docker and URL inside .env.example#3

Merged
Raumain merged 1 commit into
Raumain:mainfrom
l-carrilhogomes:feature/add-docker-postgres-server
Dec 13, 2025
Merged

✨feature : add demo postgres database with Docker and URL inside .env.example#3
Raumain merged 1 commit into
Raumain:mainfrom
l-carrilhogomes:feature/add-docker-postgres-server

Conversation

@l-carrilhogomes

Copy link
Copy Markdown
Contributor

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.

@Raumain Raumain merged commit 9546a1a into Raumain:main Dec 13, 2025
3 checks passed
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