Local Docker-based development environment managed with OpenTofu.
# First time setup or get latest data
git pull
./reset-db.sh
# Database ready in 30-60 seconds with production data!| Service | URL/Connection | Credentials |
|---|---|---|
| PostgreSQL | localhost:5434 |
postgres / changeme |
| PgAdmin | http://localhost:5050 | admin@velpharma.com / admin |
Connection string:
postgresql://postgres:changeme@localhost:5434/velpdevdb
- QUICK_START.md - Common commands and daily workflows
- DATABASE_WORKFLOW.md - Complete data management guide
- backups/README.md - Backup strategy and monthly updates
| Script | Purpose |
|---|---|
./reset-db.sh |
Reset database (loads from Git backup) |
./create-backup.sh |
Create backup from local Docker |
./backup-from-azure.sh |
Emergency: Export from Azure production |
./monitor-db.sh |
Monitor database performance |
# Start database (keeps existing data)
docker compose up -d
# Stop database
docker compose down
# View logs
docker compose logs -f postgres
# Connect via psql
docker compose exec postgres psql -U postgres -d velpdevdbThis project uses OpenTofu to generate configuration files:
# Initialize OpenTofu
tofu init
# Apply changes (regenerates .env and this README)
tofu apply
# Modify settings in variables.tf, then apply- Production backup tracked in Git (
backups/production_backup_data_only.sql) - Monthly updates run against LOCAL Docker, then committed to Git
- Team sync via
git pull && ./reset-db.sh - Azure backup available for emergencies only
See DATABASE_WORKFLOW.md for complete details.
| Issue | Solution |
|---|---|
| No data after reset | Check logs: docker compose logs postgres |
| Port conflict | Edit variables.tf, change db_port, run tofu apply |
| PgAdmin can't connect | Use host postgres (not localhost), port 5432 |
| Database won't start | Run docker compose down -v && ./reset-db.sh |
For detailed troubleshooting, see DATABASE_WORKFLOW.md.