#!/bin/bash # 启动PostgreSQL数据库 docker run -d \ --name postgres-db \ -e POSTGRES_DB=ziwei_destiny_db \ -e POSTGRES_USER=postgres \ -e POSTGRES_PASSWORD=123456 \ -p 55432:5432 \ postgres:15-alpine echo "PostgreSQL数据库已启动,等待5秒..." sleep 5 echo "检查数据库连接..." docker exec postgres-db pg_isready -U postgres -d ziwei_destiny_db echo "数据库启动完成!"