======================================== 建立 HR Portal 獨立 PostgreSQL 容器 微服務架構 - 第三個資料庫容器 ======================================== 請在 Ubuntu Server 上執行以下命令: 1. 登入: ssh ubuntu@10.1.0.254 2. 複製下面所有命令並執行 ======================================== 命令開始 (複製以下全部) ======================================== # 建立 hr-postgres 容器 docker run -d \ --name hr-postgres \ --restart unless-stopped \ -e POSTGRES_PASSWORD="DC1qaz2wsx" \ -e POSTGRES_INITDB_ARGS="--encoding=UTF-8" \ -e TZ=Asia/Taipei \ -p 0.0.0.0:5432:5432 \ -v hr-postgres-data:/var/lib/postgresql/data \ --health-cmd="pg_isready -U postgres" \ --health-interval=10s \ --health-timeout=5s \ --health-retries=5 \ postgres:16-alpine # 等待啟動 echo "Waiting for PostgreSQL to start..." sleep 10 # 建立 hr_user 和 hr_portal 資料庫 docker exec -i hr-postgres psql -U postgres <