Full-stack energy management system for Tianpu Daxing campus. - Frontend: React 19 + TypeScript + Ant Design + ECharts - Backend: FastAPI + SQLAlchemy + PostgreSQL/TimescaleDB - Features: PV monitoring, heat pump management, carbon tracking, alarms, reports Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
64 lines
1.3 KiB
YAML
64 lines
1.3 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
postgres:
|
|
image: timescale/timescaledb:latest-pg16
|
|
container_name: tianpu_db
|
|
environment:
|
|
POSTGRES_DB: tianpu_ems
|
|
POSTGRES_USER: tianpu
|
|
POSTGRES_PASSWORD: tianpu2026
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U tianpu -d tianpu_ems"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: tianpu_redis
|
|
ports:
|
|
- "6379:6379"
|
|
volumes:
|
|
- redisdata:/data
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
backend:
|
|
build: ./backend
|
|
container_name: tianpu_backend
|
|
env_file: .env
|
|
ports:
|
|
- "8000:8000"
|
|
volumes:
|
|
- ./backend:/app
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
|
|
|
|
frontend:
|
|
build: ./frontend
|
|
container_name: tianpu_frontend
|
|
ports:
|
|
- "3000:3000"
|
|
volumes:
|
|
- ./frontend:/app
|
|
- /app/node_modules
|
|
depends_on:
|
|
- backend
|
|
command: npm run dev
|
|
|
|
volumes:
|
|
pgdata:
|
|
redisdata:
|