version: '2'
services:
  # ---------------------------
  # api网关
  # ---------------------------
  gateway-service:
    image: registry.cn-hangzhou.aliyuncs.com/spring-microservice-exam/gateway-service:2.0
    container_name: gateway-service
    env_file: docker-compose.env  # 从文件中获取配置
    restart: always
    ports:
      - "8000:8000"
    networks:
      - net

  # ---------------------------
  # 授权服务
  # ---------------------------
  auth-service:
    image: registry.cn-hangzhou.aliyuncs.com/spring-microservice-exam/auth-service:2.0
    container_name: auth-service
    env_file: docker-compose.env  # 从文件中获取配置
    restart: always
    ports:
      - "8090:8090"
    networks:
      - net

  # ---------------------------
  # 用户服务
  # ---------------------------
  user-service:
    image: registry.cn-hangzhou.aliyuncs.com/spring-microservice-exam/user-service:2.0
    container_name: user-service
    env_file: docker-compose.env  # 从文件中获取配置
    restart: always
    ports:
      - "8095:8095"
    networks:
      - net

  # ---------------------------
  # 考试服务
  # ---------------------------
  exam-service:
    image: registry.cn-hangzhou.aliyuncs.com/spring-microservice-exam/exam-service:2.0
    container_name: exam-service
    env_file: docker-compose.env  # 从文件中获取配置
    restart: always
    ports:
      - "8098:8098"
    networks:
      - net

  # ---------------------------
  # 监控服务
  # ---------------------------
  monitor-service:
    image: registry.cn-hangzhou.aliyuncs.com/spring-microservice-exam/monitor-service:2.0
    container_name: monitor-service
    env_file: docker-compose.env  # 从文件中获取配置
    restart: always
    ports:
      - "8085:8085"
    networks:
      - net

networks:
  net:
    driver: bridge