postgres-docker-tutorial icon indicating copy to clipboard operation
postgres-docker-tutorial copied to clipboard

Tutorial for running PostgreSQL in Docker. For more info on how to use this repo, check out the Unbounded Systems video, How to run Postgres in Docker on YouTube: https://youtu.be/sNXVP2suMA8

PostgreSQL in Docker Tutorial

Sample setup to run Postgres in a Docker container on your local system quickly and easily. This repo is a companion to the How to run Postgres in Docker video on the Unbounded Systems YouTube Channel.

Starting Postgres

This compose file will download the official Postgres Docker container and run it on your local system, listening on the default port of 5432.

docker-compose -f postgres.yaml up

Type Control-C to stop the running container.

Initial database contents

Any files in the initdb directory will be used to initialize the database when the Postgres container is first started. The sample init.sql file shows how to create a database called sampledb.

Starting pgAdmin

This compose file can be used to run pgAdmin to monitor and manage a Postgres database. It will listen on your local system's port 8080.

docker-compose -f pgadmin.yaml up

Type Control-C to stop the running container.