การ run PostgreSQL ใน 5 นาที ด้วย docker พร้อมการ persist data ด้วย docker volume



การ run PostgreSQL ใน 5 นาที ด้วย docker พร้อมการ persist data ด้วย docker volume

การ run PostgreSQL ใน 5 นาที ด้วย docker พร้อมการ persist data ด้วย docker volume

👁 เทคนิคต่าง ๆ ที่ใช้ในคลิป
1. การ pull image จาก docker
2. การแสดง images ที่มีในเครื่อง
3. การ run postgres container
4. การทำ data persistence ด้วย volume เพื่อเก็บข้อมูลของฐานข้อมูลไว้

# script สำคัญที่ใช้ในคลิปนี้
# postgres on docker hub
https://hub.docker.com/_/postgres

# pull docker image
docker pull postgres

# list images
docker images

# run postgres on docker
docker run –name pegasus –rm -e POSTGRES_PASSWORD=banana -d -p 5432:5432 postgres

# list process
docker ps -a

# exec command in container
docker exec -it pegasus psql -U postgres

# connect to postgres from terminal
psql -U postgres -h localhost

# stop process
docker stop pegasus

# persist data (using volume)
docker run –name pegasus –rm -e POSTGRES_PASSWORD=banana -d -p 5432:5432 -v pgdatavolume:/var/lib/postgresql/data postgres

เชิญสมัครเป็นสมาชิกของช่องนี้ได้ที่ ► https://www.youtube.com/subscription_center?add_user=prasertcbs
สอน docker ► https://www.youtube.com/playlist?list=PLoTScYm9O0GGJV7UpJs6NVvsf6qaKja9_
สอน PostgreSQL ► https://www.youtube.com/playlist?list=PLoTScYm9O0GGi_NqmIu43B-PsxA0wtnyH
สอน MySQL ► https://www.youtube.com/playlist?list=PLoTScYm9O0GFmJDsZipFCrY6L-0RrBYLT
สอน Microsoft SQL Server 2012, 2014, 2016, 2017 ► https://www.youtube.com/playlist?list=PLoTScYm9O0GH8gYuxpp-jqu5Blc7KbQVn
สอน SQLite ► https://www.youtube.com/playlist?list=PLoTScYm9O0GHjYJA4pfG38M5BcrWKf5s2
สอน SQL สำหรับ Data Science ► https://www.youtube.com/playlist?list=PLoTScYm9O0GGq8M6HO8xrpkaRhvEBsQhw
การเชื่อมต่อกับฐานข้อมูล (SQL Server, MySQL, SQLite) ด้วย Python ► https://www.youtube.com/playlist?list=PLoTScYm9O0GEdZtHwU3t9k3dBAlxYoq59
การใช้ Excel ในการทำงานร่วมกับกับฐานข้อมูล (SQL Server, MySQL, Access) ► https://www.youtube.com/playlist?list=PLoTScYm9O0GGA2sSqNRSXlw0OYuCfDwYk
#prasertcbs_SQL #prasertcbs #prasertcbs_PostgreSQL #docker