Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 1.16 KB

File metadata and controls

29 lines (24 loc) · 1.16 KB

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.