version: '3'

services:
  # API-RPC服务
  api-rpc:
    build:
      context: .
      dockerfile: ./app/api/cmd/rpc/Dockerfile.dev
    volumes:
      - .:/app
      - go-mod-cache:/go/pkg/mod
    working_dir: /app/app/api/cmd/rpc
    command: air
    ports:
      - "28080:8080"
    networks:
      - qnc_net
      - service_net
    environment:
      - TZ=Asia/Shanghai
      - GO111MODULE=on
      - GOPROXY=https://goproxy.cn,direct

networks:
  # 连接到现有的环境网络
  qnc_net:
    external: true
  # 服务内部网络
  service_net:
    driver: bridge

volumes:
  go-mod-cache: