This commit is contained in:
雷雨
2025-12-15 22:05:56 +08:00
commit 8635b84b2d
230 changed files with 53888 additions and 0 deletions

96
docker/docker-compose.yml Normal file
View File

@@ -0,0 +1,96 @@
version: '3.8'
services:
# 智能家居代理系统
smart-home-agents:
build: .
container_name: smart-home-agents
ports:
- "12000:12000" # 空调代理
- "12001:12001" # 空气净化器代理
- "12002:12002" # 总管理代理
- "12003:12003" # 数据挖掘代理
volumes:
- ./config.yaml:/app/config.yaml:ro
- ./logs:/app/logs
- ./data:/app/data
environment:
- PYTHONPATH=/app
- TZ=Asia/Shanghai
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:12002/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
networks:
- smart-home-network
# StarRocks 数据库 (可选,如果使用外部数据库可以删除)
starrocks-fe:
image: starrocks/fe-ubuntu:latest
container_name: starrocks-fe
ports:
- "9030:9030" # FE HTTP端口
- "8030:8030" # FE查询端口
environment:
- FE_SERVERS=fe1:172.26.92.141:9010
- FE_ID=1
volumes:
- starrocks-fe-data:/opt/starrocks/fe/meta
networks:
- smart-home-network
command: ["/opt/starrocks/fe/bin/start_fe.sh", "--daemon"]
starrocks-be:
image: starrocks/be-ubuntu:latest
container_name: starrocks-be
ports:
- "9060:9060" # BE心跳端口
environment:
- FE_SERVERS=fe1:172.26.92.141:9010
- BE_ADDR=172.26.92.142:9050
volumes:
- starrocks-be-data:/opt/starrocks/be/storage
networks:
- smart-home-network
depends_on:
- starrocks-fe
command: ["/opt/starrocks/be/bin/start_be.sh", "--daemon"]
# Redis (用于缓存,可选)
redis:
image: redis:7-alpine
container_name: smart-home-redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
networks:
- smart-home-network
command: redis-server --appendonly yes
# Nginx (反向代理,可选)
nginx:
image: nginx:alpine
container_name: smart-home-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
depends_on:
- smart-home-agents
networks:
- smart-home-network
volumes:
starrocks-fe-data:
starrocks-be-data:
redis-data:
networks:
smart-home-network:
driver: bridge

View File

@@ -0,0 +1,99 @@
services:
starrocks-fe:
image: starrocks/fe-ubuntu:3.4-latest
container_name: moss-ai-starrocks-fe
hostname: starrocks-fe
ports:
- "9030:9030"
- "8030:8030"
environment:
- FE_SERVERS=fe1:starrocks-fe:9010
- FE_ID=1
- JAVA_OPTS=-Xmx1024m -XX:+UseG1GC
- STARROCKS_ROOT_PASSWORD=123456
volumes:
- starrocks-fe-meta:/opt/starrocks/fe/meta
- starrocks-fe-log:/opt/starrocks/fe/log
networks:
moss-ai-network:
ipv4_address: 192.168.100.2
command: ["sh", "-c", "cd /opt/starrocks/fe && ./bin/start_fe.sh && sleep infinity"]
restart: unless-stopped
deploy:
resources:
limits:
memory: 1G
reservations:
memory: 512M
starrocks-be:
image: starrocks/be-ubuntu:3.4-latest
container_name: moss-ai-starrocks-be
hostname: starrocks-be
environment:
- FE_SERVERS=fe1:starrocks-fe:9010
- BE_ADDR=192.168.100.20:9050
- JAVA_OPTS=-Xmx1536m -XX:+UseG1GC
volumes:
- starrocks-be-storage:/opt/starrocks/be/storage
- starrocks-be-log:/opt/starrocks/be/log
networks:
moss-ai-network:
ipv4_address: 192.168.100.4
depends_on:
- starrocks-fe
command: ["sh", "-c", "cd /opt/starrocks/be && ./bin/start_be.sh && sleep infinity"]
restart: unless-stopped
deploy:
resources:
limits:
memory: 2G
reservations:
memory: 1G
starrocks-cn:
image: starrocks/cn-ubuntu:3.4-latest
container_name: moss-ai-starrocks-cn
hostname: starrocks-cn
environment:
- FE_SERVERS=fe1:starrocks-fe:9010
- CN_ADDR=192.168.100.30:9051
- JAVA_OPTS=-Xmx1024m -XX:+UseG1GC
volumes:
- starrocks-cn-storage:/opt/starrocks/cn/storage
- starrocks-cn-log:/opt/starrocks/cn/log
networks:
moss-ai-network:
ipv4_address: 192.168.100.3
depends_on:
- starrocks-fe
command: ["sh", "-c", "cd /opt/starrocks/cn && ./bin/start_backend.sh --cn && sleep infinity"]
restart: unless-stopped
deploy:
resources:
limits:
memory: 1G
reservations:
memory: 512M
volumes:
starrocks-fe-meta:
driver: local
starrocks-fe-log:
driver: local
starrocks-be-storage:
driver: local
starrocks-be-log:
driver: local
starrocks-cn-storage:
driver: local
starrocks-cn-log:
driver: local
networks:
moss-ai-network:
driver: bridge
ipam:
config:
- subnet: 192.168.100.0/24
gateway: 192.168.100.1