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:
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!
Docker Postgres Official Repository:https://hub.docker.com/_/po...
Docker-compose UP https://docs.docker.com/com...
Dock Compose Tutorialhttps://docs.docker.com/com...