Skip to content

TylerDurham/psql-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

psql-docker

PostgreSQL development database template with Docker.

Quickstart

cp sample.env .env   # fill in credentials
just schema          # generate schema file from project name
just up              # start the database

Connect:

just psql            # psql shell inside the container

Recipes

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)

Environment variables

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

Structure

sql-schemas/    Init scripts — run in order on first container start
sql-queries/    Query templates for sqlc or similar code generators

About

PostgreSQL development database template with Docker.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages