修正启动脚本
This commit is contained in:
@@ -43,9 +43,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy Dart AOT runtime from build stage
|
||||
COPY --from=backend-build /runtime/ /
|
||||
|
||||
# Copy the compiled Dart server
|
||||
COPY --from=backend-build /app/bin/server /app/bin/server
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ node index.js &
|
||||
FRONTEND_PID=$!
|
||||
|
||||
# 捕获退出信号,优雅关闭两个服务
|
||||
trap "echo 'Shutting down...'; kill $BACKEND_PID $FRONTEND_PID 2>/dev/null; exit 0" SIGTERM SIGINT
|
||||
trap "echo 'Shutting down...'; kill $BACKEND_PID $FRONTEND_PID 2>/dev/null; exit 0" TERM INT
|
||||
|
||||
# 等待任意进程退出
|
||||
wait -n $BACKEND_PID $FRONTEND_PID
|
||||
|
||||
Reference in New Issue
Block a user