#!/bin/bash # ==================================== # HR Portal - 資料庫設定腳本 # ==================================== set -e echo "=== HR Portal 資料庫設定 ===" echo "" # 設定變數 DB_HOST="10.1.0.254" DB_NAME="hr_portal" DB_USER="hr_user" DB_PASSWORD="hr_password_change_me" # 請修改為強密碼 echo "連接到 PostgreSQL..." echo "" # 1. 創建資料庫用戶 (如果不存在) echo "1. 創建資料庫用戶: $DB_USER" ssh ubuntu@$DB_HOST "docker exec -i postgres psql -U postgres" <