xuzeyu
xuzeyu
发布于 2024-08-26 / 82 阅读
0

使用docker-compose启动

# 非 host 版本, 不使用本机代理
version: '3.8'
services:
  aspire-dashboard:
    container_name: aspire-dashboard
    image: mcr.microsoft.com/dotnet/aspire-dashboard:8.0
    networks:
      - antsk
    environment:
      - DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS=true
      - ASPIRE_ALLOW_UNSECURED_TRANSPORT=true
      - DASHBOARD_OTLP_AUTHMODE=ApiKey
      - DASHBOARD_OTLP_PRIMARYAPIKEY=antsk
    ports:
      - 18888:18888
      - 18889:18889
    restart: unless-stopped
  antskpg:
    image: registry.cn-hangzhou.aliyuncs.com/xuzeyu91/pg:v0.5.0 
    container_name: antskpg
    restart: always
    ports: # 生产环境建议不要暴露
      - 5432:5432
    networks:
      - antsk
    environment:
      # 这里的配置只有首次运行生效。修改后,重启镜像是不会生效的。需要把持久化数据删除再重启,才有效果
      - POSTGRES_USER=username
      - POSTGRES_PASSWORD=password
      - POSTGRES_DB=antsk
    volumes:
      - ./pg/data:/var/lib/postgresql/data
  antsk:
    container_name: antsk
    image: registry.cn-hangzhou.aliyuncs.com/xuzeyu91/antsk:v0.5.0 
    # 如果需要pytorch环境需要使用下面这个镜像,镜像比较大
    # image: registry.cn-hangzhou.aliyuncs.com/xuzeyu91/antsk:p0.5.0 
    ports:
      - 5000:5000
    networks:
      - antsk
    depends_on:
      - antskpg
    restart: always
    environment:
      - ASPNETCORE_URLS=http://*:5000
      - ASPNETCORE_FORWARDEDHEADERS_ENABLED=true
      - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES=true
      - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES= true
      - OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY=in_memory
      - OTEL_EXPORTER_OTLP_ENDPOINT=http://aspire-dashboard:18889
      - OTEL_SERVICE_NAME=antsk
    volumes:
      - ./appsettings.json:/app/appsettings.json # 本地配置文件 需要放在同级目录
      - /AntSK/model:/app/model
      - /AntSK/model:/root/.cache/modelscope/hub/AI-ModelScope # LLamaFactory模型文件
networks:
  antsk: