PostgreSQL development database template with Docker.
cp sample.env .env # fill in credentials
just schema # generate schema file from project name
just up # start the databaseConnect:
just psql # psql shell inside the container| Command | Description |
|---|---|
just schema |
Regenerate schema file from project name |
just up |
Start the database |
just down |
Stop and remove volumes |
just reset |
Wipe and restart with a clean database |
just psql |
Open a psql shell |
just logs |
Tail container logs |
just prune |
Full cleanup (containers, volumes, nets) |
Copy sample.env to .env and configure:
| Variable | Description |
|---|---|
DB_HOST |
Database host (default: localhost) |
DB_PORT |
Database port (default: 5432) |
DB_USER |
Database user |
DB_PASSWORD |
Database password |
DB_NAME |
Database name |
DB_SSLMODE |
SSL mode (default: disable) |
DATABASE_URL |
Full connection string |
sql-schemas/ Init scripts — run in order on first container start
sql-queries/ Query templates for sqlc or similar code generators