# 主服务 core（server-core / dispatcher）编排
# 统一对外生产服务 opc.pinesound.cn → core:8090（经网关，仅 loopback）

services:
  core:
    build:
      context: ../..
      dockerfile: serverrun/Dockerfile
    image: opc-core:latest
    container_name: opc-core
    restart: always
    ports:
      - "127.0.0.1:8090:8090"
    environment:
      - PINEAGENTS_DEMO_DATABASE_URL=mysql+asyncmy://opc:opc_pass@mysql:3306/opc?charset=utf8mb4
      - REDIS_URL=redis://:redis_pass@redis:6379/0
      - SESSION_SECRET=${SESSION_SECRET:?请设置 SESSION_SECRET}
      - TZ=Asia/Shanghai
    volumes:
      - ../../serverdata:/app/serverdata
    depends_on:
      - redis
      - mysql
    networks:
      - opc-network

networks:
  opc-network:
    name: opc-network
    external: true
