31 lines
695 B
YAML
31 lines
695 B
YAML
services:
|
||
backend:
|
||
build: ./backend
|
||
# 使用 gunicorn 替代 runserver,提高稳定性
|
||
command: sh -c "python manage.py migrate && gunicorn --bind 0.0.0.0:8000 config.wsgi:application"
|
||
volumes:
|
||
- ./backend:/app
|
||
ports:
|
||
- "8000:8000"
|
||
environment:
|
||
- DB_NAME=market
|
||
- DB_USER=market
|
||
- DB_PASSWORD=123market
|
||
- DB_HOST=6.6.6.66
|
||
- DB_PORT=5432
|
||
|
||
frontend:
|
||
build:
|
||
context: ./frontend
|
||
args:
|
||
- VITE_API_URL=/api
|
||
# volumes:
|
||
# - ./frontend:/app
|
||
# - /app/node_modules
|
||
ports:
|
||
- "15173:15173"
|
||
environment:
|
||
- VITE_API_URL=http://localhost:8000/api
|
||
depends_on:
|
||
- backend
|