postgresql docker volume 1

postgresql docker volume

-v /custom/mount:/var/lib/postgresql/data

Here is what the above code is Doing:
1. We’re using the official PostgreSQL image from Docker Hub.
2. We’re setting the POSTGRES_PASSWORD environment variable to a password of our choosing.
3. We’re exposing the default PostgreSQL port (5432) so that external applications can access it.
4. We’re mounting a volume called custom-mount to /var/lib/postgresql/data. This is where PostgreSQL stores its data.

Similar Posts