Files
Scoring-System/docker-compose.yml
爽哒哒 f33b188922
Some checks failed
Deploy to Server / deploy (push) Failing after 50m2s
优化部署配置:修复端口、优化前端依赖、更新docker-compose
2026-03-19 18:55:35 +08:00

54 lines
1.4 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
services:
backend:
build: ./backend
container_name: cywl-scoring-backend
# 使用 gunicorn 替代 runserver提高稳定性并捕获标准输出
command: sh -c "python manage.py collectstatic --noinput && python manage.py migrate && gunicorn --bind 0.0.0.0:8876 --access-logfile - --error-logfile - config.wsgi:application"
volumes:
- ./backend:/app
- ./backend/media:/app/media
ports:
- "8876:8876"
environment:
- DB_NAME=sign-up
- DB_USER=sign-up
- DB_PASSWORD=123market
- DB_HOST=6.6.6.66
- DB_PORT=5432
networks:
- scoring_network
healthcheck:
test: ["CMD", "python", "-c", "import requests; requests.get('http://localhost:8876/api/health/')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
frontend:
build:
context: ./frontend
args:
- VITE_API_URL=/api
container_name: cywl-scoring-frontend
# volumes:
# - ./frontend:/app
# - /app/node_modules
ports:
- "8890:8890"
environment:
- VITE_API_URL=http://backend:8876/api
depends_on:
backend:
condition: service_healthy
networks:
- scoring_network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8890/health"]
interval: 30s
timeout: 10s
retries: 3
networks:
scoring_network:
driver: bridge