Production-grade shared infrastructure services using Docker Compose.
This repository manages shared backend infrastructure components independently from domain microservices.
- PostgreSQL 16 Alpine: Shared database engine exposed on host port
5433(5432internally).
- Docker (version 24.0+)
- Docker Compose (version 2.20+)
Copy the template environment file and set secure password credentials:
cp .env.example .envStart the PostgreSQL container in detached mode:
docker compose up -dGracefully stop the running containers:
docker compose downView and follow container logs:
# Follow logs for all services
docker compose logs -f
# Follow logs for PostgreSQL database container only
docker compose logs -f dbExecute an interactive psql shell inside the running database container:
docker compose exec db psql -U postgres -d trading_dbOr connect from the host machine using external port 5433:
psql -h localhost -p 5433 -U postgres -d trading_dbTo completely remove persistent data volumes and reset the database:
Caution
This command permanently deletes all data in the shared_postgres_data volume.
docker compose down -v- Secrets Management: Never commit
.envfiles containing actual production passwords to Git. - Access Control: Keep host port
5433restricted to localhost or protected internal networks.