Up a PostgreSQL Container with Volume Persistent and expose port

Spread the love
sudo docker run -d     
--name postgres
-e POSTGRES_PASSWORD=password   
-e POSTGRES_USER=root 
-e POSTGRES_DB=postgres  
-e PGDATA=/var/lib/postgresql/data/pgdata     
-v /tmp/postgres-data:/var/lib/postgresql/data 
-p 5432:5432    
postgres
parathantl Avatar

Leave a Reply

Your email address will not be published. Required fields are marked *