A containerized PostgreSQL environment I use for local development and testing.
Modify the .env file to customize the database settings.
- Docker
- Docker Compose
- Clone the repository
- Place your
data.dumpfile in the root directory (if you have one) - Modify
.envfile with your preferred settings - Add any SQL scripts to
homework/*.sqlfor automatic execution during initialization
Start the container:
docker compose up -dConnect to PostgreSQL:
psql -h localhost -p 2345 -U tanmay -d postgresRemove the container:
docker compose down -v- Automatic database initialization from dump file
- Custom SQL script execution on startup
- Persistent data storage
- Configurable through environment variables
- Port mapping for local access
See .env file for customizable settings:
- Database credentials
- Port mappings
- Container naming