refactor: 统一启动脚本到planet.sh,修复resetView调用

- 新增planet.sh统一管理start/stop/restart/health/log命令
- docker-compose.yml只保留postgres和redis
- controls.js点击事件调用resetView函数
This commit is contained in:
rayd1o
2026-03-18 18:09:12 +08:00
parent 3b0e9dec5a
commit 11a9dda942
6 changed files with 133 additions and 295 deletions

View File

@@ -31,51 +31,6 @@ services:
timeout: 5s
retries: 5
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: planet_backend
ports:
- "8000:8000"
env_file:
- .env
environment:
- DATABASE_URL=postgresql+asyncpg://postgres:postgres@postgres:5432/planet_db
- REDIS_URL=redis://redis:6379/0
- SECRET_KEY=your-secret-key-change-in-production
- CORS_ORIGINS=["http://localhost:3000","http://0.0.0.0:3000","http://frontend:3000"]
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./backend:/app
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: planet_frontend
ports:
- "3000:3000"
environment:
- VITE_API_URL=http://backend:8000/api/v1
- VITE_WS_URL=ws://backend:8000/ws
volumes:
- ./frontend/public:/app/public
depends_on:
backend:
condition: service_healthy
stdin_open: true
tty: true
volumes:
postgres_data:
redis_data: