Dream-MachineProcurementList/scripts/prod-up.sh
Chever John 31801d0991
Updates application port to 3004
WHAT: Updates the application's default port from 8080 to 3004 across various Docker configurations and scripts. This includes changes to Dockerfiles, docker-compose files, and startup scripts. Also updates the vite config.
WHY: Standardizes the port used by the application to 3004 for consistency and to avoid potential conflicts with other services that might be using port 8080.
HOW: Modifies the `EXPOSE` directives in the Dockerfiles, the port mappings in the docker-compose files, the default port in the main application server file, the port in the vite config and the scripts that display the API URL.
2025-08-21 14:55:16 +08:00

21 lines
554 B
Bash

#!/usr/bin/env bash
set -euo pipefail
echo "[Dream-Machine] 生产环境启动"
echo "- 目标平台: linux/amd64"
echo "- 将使用宿主机构建的前端 (dist/)"
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
ROOT_DIR=$(cd "$SCRIPT_DIR/.." && pwd)
if [ ! -d "$ROOT_DIR/dist" ]; then
echo "[错误] 未检测到 dist/。请先在宿主机运行: pnpm run build"
exit 1
fi
echo "[步骤] 启动 Docker Compose (生产)"
(cd "$ROOT_DIR/docker" && docker compose -f docker-compose.prod.yml up -d --build)
echo "[完成] API: http://localhost:3004"