feat: 拆分新旧前端访问端口

This commit is contained in:
2026-05-15 13:54:17 +08:00
parent 279e5d7364
commit f8ed9199b0
9 changed files with 137 additions and 47 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ COPY --from=frontend-build /frontend/dist /app/frontend/dist
RUN chmod +x /app/start.sh 2>/dev/null || true
EXPOSE 9081
EXPOSE 9081 9082
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD curl -f http://localhost:9081/health || exit 1
+1 -1
View File
@@ -55,4 +55,4 @@ sh update.sh
- 默认镜像版本
- 版本要求范围
- 数据库账号密码
- 端口映射
- 端口映射:新版前端 `19081 -> 9081`,旧版前端 `19082 -> 9082`
+12 -5
View File
@@ -36,8 +36,12 @@ MYSQL_HOST = "capacity-mysql"
MYSQL_PORT = 3306
# 应用端口映射
APP_PORT_HOST = 19081
APP_PORT_CONTAINER = 9081
APP_NEW_PORT_HOST = 19081
APP_NEW_PORT_CONTAINER = 9081
APP_OLD_PORT_HOST = 19082
APP_OLD_PORT_CONTAINER = 9082
APP_PORT_HOST = APP_NEW_PORT_HOST
APP_PORT_CONTAINER = APP_NEW_PORT_CONTAINER
MYSQL_PORT_HOST = 13306
MYSQL_PORT_CONTAINER = 3306
@@ -294,7 +298,8 @@ check_port() {{
fi
{{}}
check_port {APP_PORT_HOST} "App"
check_port {APP_NEW_PORT_HOST} "New frontend"
check_port {APP_OLD_PORT_HOST} "Old frontend"
check_port {MYSQL_PORT_HOST} "MySQL"
echo ""
@@ -441,7 +446,8 @@ echo "=========================================="
echo "Deployment completed!"
echo "=========================================="
echo ""
echo "Access: http://localhost:{APP_PORT_HOST}"
echo "New frontend: http://localhost:{APP_NEW_PORT_HOST}"
echo "Old frontend: http://localhost:{APP_OLD_PORT_HOST}"
echo ""
echo "Commands:"
echo " Logs: $DOCKER_COMPOSE_CMD logs -f"
@@ -637,7 +643,8 @@ echo "=========================================="
echo "Update completed!"
echo "=========================================="
echo ""
echo "Application: http://localhost:{APP_PORT_HOST}"
echo "New frontend: http://localhost:{APP_NEW_PORT_HOST}"
echo "Old frontend: http://localhost:{APP_OLD_PORT_HOST}"
echo ""
echo "Database status:"
if docker ps --format "{{.Names}}" | grep -q "capacity-mysql"; then
+1
View File
@@ -16,6 +16,7 @@ services:
restart: unless-stopped
ports:
- "19081:9081"
- "19082:9082"
volumes:
# 持久化数据
- ./cache:/app/cache