version: "3"

services:
  #  rabbitmq:
  #    image: rabbitmq:management
  #    ports:
  #      - 5672:5672
  #      - 15672:15672
  #    networks:
  #      - my-network

  # kafka:
  #   container_name: kafka
  #   image: spotify/kafka:latest
  #   ports:
  #    - 2181:2181
  #    - 9092:9092
  #   networks:
  #     - my-network

  #  zipkin:
  #    image: openzipkin/zipkin
  #    ports:
  #      - 9411:9411
  #    networks:
  #      - my-network

  redis:
    image: redis
    ports:
      - 6379:6379
    networks:
      - my-network

  ts-ui-dashboard:
    build: ts-ui-dashboard
    image: ${IMG_REPO}/ts-ui-dashboard:${IMG_TAG}
    restart: always
    ports:
      - 8080:8080
    networks:
      - my-network

  ts-auth-service:
    build: ts-auth-service
    image: ${IMG_REPO}/ts-auth-service:${IMG_TAG}
    restart: always
    ports:
      - 12340:12340
    networks:
      - my-network

  ts-auth-mongo:
    image: mongo
    networks:
      - my-network

  ts-user-service:
    build: ts-user-service
    image: ${IMG_REPO}/ts-user-service:${IMG_TAG}
    restart: always
    ports:
      - 12342:12342
    networks:
      - my-network

  ts-user-mongo:
    image: mongo
    networks:
      - my-network

  ts-verification-code-service:
    build: ts-verification-code-service
    image: ${IMG_REPO}/ts-verification-code-service:${IMG_TAG}
    restart: always
    ports:
      - 15678:15678
    networks:
      - my-network

  ts-account-mongo:
    image: mongo
    networks:
      - my-network

  ts-route-service:
    build: ts-route-service
    image: ${IMG_REPO}/ts-route-service:${IMG_TAG}
    restart: always
    ports:
      - 11178:11178
    networks:
      - my-network

  ts-route-mongo:
    image: mongo
    networks:
      - my-network

  ts-contacts-service:
    build: ts-contacts-service
    image: ${IMG_REPO}/ts-contacts-service:${IMG_TAG}
    restart: always
    ports:
      - 12347:12347
    networks:
      - my-network

  ts-contacts-mongo:
    image: mongo
    networks:
      - my-network

  ts-order-service:
    build: ts-order-service
    image: ${IMG_REPO}/ts-order-service:${IMG_TAG}
    restart: always
    ports:
      - 12031:12031
    networks:
      - my-network

  ts-order-mongo:
    image: mongo
    networks:
      - my-network

  ts-order-other-service:
    build: ts-order-other-service
    image: ${IMG_REPO}/ts-order-other-service:${IMG_TAG}
    restart: always
    ports:
      - 12032:12032
    networks:
      - my-network

  ts-order-other-mongo:
    image: mongo
    networks:
      - my-network

  ts-config-service:
    build: ts-config-service
    image: ${IMG_REPO}/ts-config-service:${IMG_TAG}
    restart: always
    ports:
      - 15679:15679
    networks:
      - my-network

  ts-config-mongo:
    image: mongo
    networks:
      - my-network

  ts-station-service:
    build: ts-station-service
    image: ${IMG_REPO}/ts-station-service:${IMG_TAG}
    restart: always
    ports:
      - 12345:12345
    networks:
      - my-network

  ts-station-mongo:
    image: mongo
    networks:
      - my-network

  ts-train-service:
    build: ts-train-service
    image: ${IMG_REPO}/ts-train-service:${IMG_TAG}
    restart: always
    ports:
      - 14567:14567
    networks:
      - my-network

  ts-train-mongo:
    image: mongo
    networks:
      - my-network

  ts-travel-service:
    build: ts-travel-service
    image: ${IMG_REPO}/ts-travel-service:${IMG_TAG}
    restart: always
    ports:
      - 12346:12346
    networks:
      - my-network

  ts-travel-mongo:
    image: mongo
    networks:
      - my-network

  ts-travel2-service:
      build: ts-travel2-service
      image: ${IMG_REPO}/ts-travel2-service:${IMG_TAG}
      restart: always
      ports:
        - 16346:16346
      networks:
        - my-network

  ts-travel2-mongo:
    image: mongo
    networks:
      - my-network

  ts-preserve-service:
    build: ts-preserve-service
    image: ${IMG_REPO}/ts-preserve-service:${IMG_TAG}
    restart: always
    ports:
      - 14568:14568
    networks:
      - my-network

  ts-preserve-other-service:
    build: ts-preserve-other-service
    image: ${IMG_REPO}/ts-preserve-other-service:${IMG_TAG}
    restart: always
    ports:
      - 14569:14569
    networks:
      - my-network

  ts-basic-service:
      build: ts-basic-service
      image: ${IMG_REPO}/ts-basic-service:${IMG_TAG}
      restart: always
      ports:
        - 15680:15680
      networks:
          - my-network

  ts-ticketinfo-service:
        build: ts-ticketinfo-service
        image: ${IMG_REPO}/ts-ticketinfo-service:${IMG_TAG}
        restart: always
        ports:
          - 15681:15681
        networks:
          - my-network

  ts-price-service:
        build: ts-price-service
        image: ${IMG_REPO}/ts-price-service:${IMG_TAG}
        restart: always
        ports:
          - 16579:16579
        networks:
          - my-network


  ts-price-mongo:
    image: mongo
    networks:
      - my-network

  ts-notification-service:
        build: ts-notification-service
        image: ${IMG_REPO}/ts-notification-service:${IMG_TAG}
        restart: always
        ports:
          - 17853:17853
        networks:
          - my-network

  ts-security-service:
        build: ts-security-service
        image: ${IMG_REPO}/ts-security-service:${IMG_TAG}
        restart: always
        ports:
          - 11188:11188
        networks:
          - my-network

  ts-security-mongo:
    image: mongo
    networks:
      - my-network

  ts-inside-payment-service:
        build: ts-inside-payment-service
        image: ${IMG_REPO}/ts-inside-payment-service:${IMG_TAG}
        restart: always
        ports:
          - 18673:18673
        networks:
          - my-network

  ts-inside-payment-mongo:
    image: mongo
    networks:
      - my-network

  ts-execute-service:
        build: ts-execute-service
        image: ${IMG_REPO}/ts-execute-service:${IMG_TAG}
        restart: always
        ports:
          - 12386:12386
        networks:
          - my-network

  ts-payment-service:
        build: ts-payment-service
        image: ${IMG_REPO}/ts-payment-service:${IMG_TAG}
        restart: always
        ports:
          - 19001:19001
        networks:
          - my-network

  ts-payment-mongo:
    image: mongo
    networks:
      - my-network

  ts-rebook-service:
        build: ts-rebook-service
        image: ${IMG_REPO}/ts-rebook-service:${IMG_TAG}
        restart: always
        ports:
          - 18886:18886
        networks:
          - my-network

  ts-rebook-mongo:
    image: mongo
    networks:
      - my-network

  ts-cancel-service:
        build: ts-cancel-service
        image: ${IMG_REPO}/ts-cancel-service:${IMG_TAG}
        restart: always
        ports:
          - 18885:18885
        networks:
          - my-network

  ts-assurance-service:
        build: ts-assurance-service
        image: ${IMG_REPO}/ts-assurance-service:${IMG_TAG}
        restart: always
        ports:
          - 18888:18888
        networks:
          - my-network

  ts-assurance-mongo:
    image: mongo
    networks:
      - my-network

  ts-seat-service:
        build: ts-seat-service
        image: ${IMG_REPO}/ts-seat-service:${IMG_TAG}
        restart: always
        ports:
          - 18898:18898
        networks:
          - my-network

  ts-travel-plan-service:
        build: ts-travel-plan-service
        image: ${IMG_REPO}/ts-travel-plan-service:${IMG_TAG}
        restart: always
        ports:
          - 14322:14322
        networks:
          - my-network

  ts-ticket-office-service:
        build: ts-ticket-office-service
        image: ${IMG_REPO}/ts-ticket-office-service:${IMG_TAG}
        restart: always
        ports:
          - 16108:16108
        networks:
          - my-network

  ts-ticket-office-mongo:
    image: mongo
    networks:
      - my-network

  ts-news-service:
    build: ts-news-service
    image: ${IMG_REPO}/ts-news-service:${IMG_TAG}
    restart: always
    ports:
      - 12862:12862
    networks:
      - my-network

  ts-news-mongo:
    image: mongo
    networks:
      - my-network

  ts-voucher-mysql:
    image: mysql
    expose:
      - "3306"
    environment:
      MYSQL_ROOT_PASSWORD: root
    networks:
      - my-network

  ts-voucher-service:
          build: ts-voucher-service
          image: ${IMG_REPO}/ts-voucher-service:${IMG_TAG}
          restart: always
          ports:
            - 16101:16101
          depends_on:
            - ts-voucher-mysql
          volumes:
            - /var/lib/mysql
          networks:
            - my-network

  ts-food-map-service:
        build: ts-food-map-service
        image: ${IMG_REPO}/ts-food-map-service:${IMG_TAG}
        restart: always
        ports:
          - 18855:18855
        networks:
          - my-network

  ts-food-map-mongo:
    image: mongo
    networks:
      - my-network

  ts-route-plan-service:
          build: ts-route-plan-service
          image: ${IMG_REPO}/ts-route-plan-service:${IMG_TAG}
          restart: always
          ports:
            - 14578:14578
          networks:
            - my-network

  ts-food-service:
      build: ts-food-service
      image: ${IMG_REPO}/ts-food-service:${IMG_TAG}
      restart: always
      ports:
        - 18856:18856
      networks:
        - my-network

  ts-consign-service:
            build: ts-consign-service
            image: ${IMG_REPO}/ts-consign-service:${IMG_TAG}
            restart: always
            ports:
              - 16111:16111
            networks:
              - my-network

  ts-consign-mongo:
    image: mongo
    networks:
      - my-network

  ts-consign-price-service:
            build: ts-consign-price-service
            image: ${IMG_REPO}/ts-consign-price-service:${IMG_TAG}
            restart: always
            ports:
              - 16110:16110
            networks:
              - my-network

  ts-consign-price-mongo:
    image: mongo
    networks:
      - my-network

  ts-food-mongo:
    image: mongo
    networks:
      - my-network

  ts-admin-basic-info-service:
        build: ts-admin-basic-info-service
        image: ${IMG_REPO}/ts-admin-basic-info-service:${IMG_TAG}
        restart: always
        ports:
          - 18767:18767
        networks:
          - my-network

  ts-admin-order-service:
            build: ts-admin-order-service
            image: ${IMG_REPO}/ts-admin-order-service:${IMG_TAG}
            restart: always
            ports:
              - 16112:16112
            networks:
              - my-network

  ts-admin-route-service:
              build: ts-admin-route-service
              image: ${IMG_REPO}/ts-admin-route-service:${IMG_TAG}
              restart: always
              ports:
                - 16113:16113
              deploy:
                replicas: 1
                restart_policy:
                  condition: on-failure
              networks:
                - my-network

  ts-admin-travel-service:
                build: ts-admin-travel-service
                image: ${IMG_REPO}/ts-admin-travel-service:${IMG_TAG}
                restart: always
                ports:
                  - 16114:16114
                deploy:
                  replicas: 1
                  restart_policy:
                    condition: on-failure
                networks:
                  - my-network

  ts-admin-user-service:
    build: ts-admin-user-service
    image: ${IMG_REPO}/ts-admin-user-service:${IMG_TAG}
    restart: always
    ports:
      - 16115:16115
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure
    networks:
      - my-network

  ts-avatar-service:
    image: ${NAMESPACE}/ts-avatar-service:${TAG}
    restart: always
    ports:
      - 17001:17001
    networks:
      - my-network

networks:
  my-network:
    # driver: overlay
    driver: bridge
