Commit dd4f5471 authored by bin.gong's avatar bin.gong

Update Dockerfile

parent ff411655
...@@ -51,19 +51,16 @@ COPY --from=node-base /usr/local/lib/node_modules/ /usr/local/lib/node_modules/ ...@@ -51,19 +51,16 @@ COPY --from=node-base /usr/local/lib/node_modules/ /usr/local/lib/node_modules/
# 复制资源文件 # 复制资源文件
COPY .resource/ /app/.resource/ COPY .resource/ /app/.resource/
# 拷贝启动脚本
COPY start.sh /app/start.sh
# 设置环境变量 # 设置环境变量
ENV RESOURCE_PATH=/app/.resource/resource_deploy.json ENV RESOURCE_PATH=/app/.resource/resource_deploy.json
ENV PYTHONPATH=/app/backend ENV PYTHONPATH=/app/backend
ENV NODE_ENV=production ENV NODE_ENV=production
# 创建启动脚本 # 设置启动脚本权限
RUN echo '#!/bin/bash\n\ RUN chmod +x /app/start.sh
# 启动 Python 后端\n\
cd /app/backend && python app.py &\n\
# 启动 Node.js 前端\n\
cd /app/frontend && node server.js &\n\
# 等待所有后台进程\n\
wait' > /app/start.sh && chmod +x /app/start.sh
# 暴露端口 # 暴露端口
EXPOSE $APP_PORT_1 $APP_PORT_2 EXPOSE $APP_PORT_1 $APP_PORT_2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment