更新 docker-compose.yml 和 supervisord.conf: 重构服务配置,合并前后端服务,调整端口映射和启动命令。
This commit is contained in:
32
Dockerfile
Normal file
32
Dockerfile
Normal file
@ -0,0 +1,32 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
# 安装 Node.js 和 supervisord
|
||||
RUN apt-get update && \
|
||||
apt-get install -y curl supervisor && \
|
||||
curl -fsSL https://deb.nodesource.com/setup_21.x | bash - && \
|
||||
apt-get install -y nodejs && \
|
||||
apt-get clean
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 复制前端代码并安装依赖、构建
|
||||
COPY platform/ ./platform/
|
||||
WORKDIR /app/platform
|
||||
RUN npm install && npm run build
|
||||
|
||||
# 安装 http-server
|
||||
RUN npm install -g http-server
|
||||
|
||||
# 复制后端代码并安装依赖
|
||||
WORKDIR /app/back
|
||||
COPY back/requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
COPY back/ .
|
||||
|
||||
# supervisor 配置
|
||||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
||||
Reference in New Issue
Block a user