Dockerize nodejs postgres app
We will use an existing application/API with Node.js and Postgres replacing a remote Postgres with a local one running with Docker and Docker compose, so it would be advisable to read the previous post about it.An intermediate understanding of how relational databases work, especially PostgreSQL would be highly beneficial.For this guide, we will use the docker-compose version 1.29.1 on a Mac.
Any prior grasp on Docker compose would be useful but not necessary.For this tutorial, docker version 20.10.10 will be used in a Mac. Basic knowledge of Docker will be helpful like executing commands like docker run, execute, etc.
#Dockerize nodejs postgres app code
Prerequisites #īefore we dive into some CLI commands and a bit of code below are some prerequisites best to have: In the following section, we will look into some good to have things before diving into the commands to run Postgres with Docker.
You can read more about this on why to use docker.
#Dockerize nodejs postgres app how to
In this post, we will look into how to run and use Postgres with Docker and Docker compose step-by-step keeping things simple and easy. Running Postgres with Docker and docker-compose makes it very easy to run and maintain especially in a development environment. This official feature matrix shows the wealth of features Postgres has. Postgres (a.k.a PostgreSQL) is an open-source, standards-compliant, and object-relational database been developed for more than 30 years now. Docker has shot up in popularity over the years.