Docker PostgreSQL Tutorial – Running In 3 Minutes Quick Start



Docker PostgreSQL Tutorial – Running In 3 Minutes Quick Start

Docker PostgreSQL Tutorial - Running In 3 Minutes Quick Start

I show you how to quickly create a Docker PostgreSQL local database instance.

Additionally, perform a database migration and execute your SQL scripts on the postgreSQL service start up.

In order to perform a database migration to create your schema, tables, objects and SQL statements we will extend the image by placing the local .sql files into the containers directory:

/docker-entrypoint-initdb.d

This can be done by using mapping a docker volume from the host directory to the container directory above.

We map our host port 5432 to the containers port 5432 so other applications running on the host can access the postgreSQL instance. (such as dbvisualizer, java applications, other systems etc)

Control C will gracefully terminate the container instance, but the image will still live on your machine until you remote it.

All of the above is execute with docker compose UP command.

Don’t forget to subscribe!
Next video on Jooq persistance framework!
Philip

Docker Postgres Official Repository:
https://hub.docker.com/_/postgres/

Docker-compose UP
https://docs.docker.com/compose/reference/up/

Ubuntu
https://www.ubuntu.com/

Dock Compose Tutorial
https://docs.docker.com/compose/

Comments are closed.