feat: docker-compose.yml
This commit is contained in:
parent
45fab652a0
commit
fbc1d0a6ae
|
|
@ -9,6 +9,7 @@ __pycache__/
|
|||
venv/
|
||||
.idea/
|
||||
.vscode/
|
||||
.data/
|
||||
|
||||
# ---- Python (backend) ----
|
||||
backend/__pycache__/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
# ====== python step ======
|
||||
FROM python:3.13 AS python
|
||||
# ====== install step ======
|
||||
FROM python AS install
|
||||
# ENV PIP_SOURCE https://pypi.tuna.tsinghua.edu.cn/simple/
|
||||
ENV PIP_SOURCE https://mirrors.aliyun.com/pypi/simple
|
||||
WORKDIR /app
|
||||
COPY requirements.txt /app/requirements.txt
|
||||
RUN pip install -i $PIP_SOURCE --upgrade pip --timeout=100
|
||||
RUN pip3 install -i $PIP_SOURCE -r requirements.txt
|
||||
# ====== run step ======
|
||||
FROM install AS run
|
||||
COPY . /app
|
||||
# CMD ["python", "server.py"]
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["python3"]
|
||||
CMD ["server.py"]
|
||||
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
services:
|
||||
workflow-server:
|
||||
container_name: workflow-server
|
||||
networks:
|
||||
- workflow
|
||||
build:
|
||||
context: ./backend
|
||||
volumes:
|
||||
- .data/:/app/app/config/
|
||||
|
||||
workflow-web:
|
||||
container_name: workflow-web
|
||||
networks:
|
||||
- workflow
|
||||
image: nginx:alpine
|
||||
volumes:
|
||||
- ./frontend/dist:/usr/share/nginx/html # 挂载前端构建文件
|
||||
- ./frontend/nginx.conf:/etc/nginx/conf.d/default.conf # 挂载 Nginx 配置
|
||||
ports:
|
||||
- "1338:80" # 将 Nginx 的 80 端口映射到主机的 1337 端口
|
||||
depends_on:
|
||||
- dbdai-server # 确保 Sanic 服务先启动
|
||||
networks:
|
||||
ai-guard:
|
||||
external: true
|
||||
Loading…
Reference in New Issue