connectorsilikon.blogg.se

Dockerize nodejs postgres app
Dockerize nodejs postgres app







dockerize nodejs postgres app

Thank you !! Please share your queries and feedback in the comments section. This will allow pgAdmin to connect to the postgreSQL database.In the connection details for hostname give the container name of postgreSQL To configure pgadmin – open a browser and go to –.To view the logs, use command docker logs -f local_pgdb.If all goes well, then below message will be displayed.Now run the below command to run postgreSQL and pgAdmin4 in a detached mode.When you stop or down the docker container, the database and connection details will still be there. Docker volumes are the recommended way to persist data.I was not able to make docker persist the connect details with any other path Inorder for pgAdmin to persist the connection details even after the container is shutdown, we need to provide volume and that is provided under volumes section.The above config will create volume name local_pgdata and mount this volume to container’s path. Its the path in the host where the database data is stored. volumes tag is used to mount a folder from the host machine to the container.environment defines a set of environment variables, for both services we have set the user id and password.It maps port 54320 on the host to port 5432 on the container for postgreSQL and 5050 on the host to port 80 on container for pgAdmin

dockerize nodejs postgres app

ports is used to define both host and container ports.restart always will restart the container when either the Docker daemon restarts or the container itself is manually restarted.container_name is used to define container names for postgreSQL & pgAdmin, the default values are overridden by local_pgdb and pgadmin4_container values.Inside this, we have to define 2 services postgreSQLand pgAdmin You can read more from Docker’s documentation. First line defines the version of the compose file which is 3.8.Add the following content in the docker-compose,yml file.create a file and name it as docker-compose.yml.Mkdir postgres-docker & cd postgres-docker









Dockerize nodejs postgres app