Files
nonye/docker-compose.yml

30 lines
672 B
YAML
Raw Normal View History

version: '3.8'
services:
backend:
2025-07-18 22:26:19 +08:00
image: python:3.11-bookworm # 使用Debian-based的官方镜像
container_name: backend
ports:
- "7792:5000"
volumes:
2025-07-18 22:26:19 +08:00
- ./back:/app
2025-07-18 22:18:34 +08:00
working_dir: /app
environment:
- FLASK_ENV=development
2025-07-18 22:18:34 +08:00
command: >
2025-07-18 22:26:19 +08:00
sh -c "python -m pip install --upgrade pip &&
pip install -r requirements.txt &&
python app.py"
depends_on:
- frontend
2025-07-18 22:18:34 +08:00
frontend:
2025-07-18 22:26:19 +08:00
image: node:21
container_name: frontend
ports:
2025-07-18 22:26:19 +08:00
- "7793:5173"
volumes:
- ./platform:/app
2025-07-18 22:18:34 +08:00
working_dir: /app
environment:
2025-07-18 22:18:34 +08:00
- NODE_ENV=development
2025-07-18 22:26:19 +08:00
command: sh -c "npm install && npm run dev"