Skip to content

gnvr29/PostgreSQL-docker-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PostgreSQL-docker-tutorial

Tutorial used during Levty's backend Journey about creating and running a local PostgreSQL container.

Execute the following to start the container:

docker compose up -d

Once the container is running, execute the following to enter the postgres CLI:

docker exec -it <container-name> -U <postgres-username> -d <database-name>

You can then copy and paste the SQL commands in the terminal and check if everything worked as intented.

You can also execute one of the following commands to check for DB and connection metadata:

SELECT version();
\conninfo;

Type \q to exit the CLI, use the following command to stop the container:

docker compose down

Add the -v flag to remove the volume as well.

About

Tutorial used during Levty's backend Journey about creating and running a local PostgreSQL container.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published