version: "3.9"

services:
  whoami:
    image: "traefik/whoami"
    expose: #expose port to other container by using http://whoami:80
      - "80"
    restart: unless-stopped

  weloveparty_account_auth_service:
    build: 
      context: ../python_user_auth_system
      dockerfile: ./Dockerfile
    image: yingshaoxo/weloveparty_account_auth_service
    expose:
      - "40051"
      - "40052"
      - "25"
    # ports:
    #   - "40051:40051"
    #   - "40052:40052"
    volumes:
      # - type: bind
      #   source: ./configs/python_user_auth_system/o365_token.txt
      #   target: /code/o365_token.txt
      - type: bind
        source: ./configs/python_user_auth_system/config.py
        target: /code/src/config.py
      # - type: bind
      #   source: ./configs/python_user_auth_system/user_database
      #   target: /code/data
    environment: 
      - redis_network_name=redis
      - Telegram_Bot_Token=684605925:AAEXowAYAJqh_CImJnnYKKp5iDYUovjD9FQ
    restart: unless-stopped

  weloveparty_internal_api_service:
    build: 
      context: ../rust_internal_api_system
      dockerfile: ./Dockerfile
    image: yingshaoxo/weloveparty_internal_api_service
    expose:
      - "40050"
    # ports:
    #   - "40050:40050"
    environment: 
      - redis_network_name=redis
      - postgres_sql_host=db
      - postgres_sql_user=yingshaoxo
      - postgres_sql_password=yingshaoxo
    restart: unless-stopped

  # weloveparty_account_auth_service:
  #   build: 
  #     context: ../python_user_auth_system
  #     dockerfile: ./Dockerfile
  #   image: yingshaoxo/weloveparty_account_auth_service
  #   expose:
  #     - "40051"
  #     - "40052"
  #     - "25"
  #   # ports:
  #   #   - "40051:40051"
  #   #   - "40052:40052"
  #   volumes:
  #     - type: bind
  #       source: ./configs/python_user_auth_system/o365_token.txt
  #       target: /code/o365_token.txt
  #     - type: bind
  #       source: ./configs/python_user_auth_system/config.py
  #       target: /code/src/config.py
  #     - type: bind
  #       source: ./configs/python_user_auth_system/user_database
  #       target: /code/data
  #   environment: 
  #     - redis_network_name=redis
  #   restart: unless-stopped

  weloveparty_account_storage_service:
    build: 
      context: ../golang_user_storage_system
      dockerfile: ./Dockerfile
    image: yingshaoxo/weloveparty_golang_user_storage_system
    expose:
      - "40053"
    # ports:
    #   - "40053:40053"
    environment: 
      - redis_network_name=redis
      - postgres_sql_host=db
      - postgres_sql_user=yingshaoxo
      - postgres_sql_password=yingshaoxo
      - GRPC_GO_LOG_SEVERITY_LEVEL=info
      - GRPC_GO_LOG_VERBOSITY_LEVEL=0
    restart: unless-stopped

  weloveparty_free_map_service:
    build: 
      context: ../java_free_map_backend_system
      dockerfile: ./Dockerfile
    image: yingshaoxo/weloveparty_free_map_backend_service
    expose:
      - "40055"
    # ports:
    #   - "40055:40055"
    # volumes:
    #   - type: bind
    #     source: ./configs/python_chat_with_friends_system/config.py
    #     target: /code/src/config.py
    environment: 
      - redis_network_name=redis
      - postgres_sql_host=db
      - postgres_sql_user=yingshaoxo
      - postgres_sql_password=yingshaoxo
    restart: unless-stopped

  weloveparty_chat_with_friends_service:
    build: 
      context: ../python_chat_with_friends_system
      dockerfile: ./Dockerfile
    image: yingshaoxo/weloveparty_chat_with_friends_service
    expose:
      - "40056"
    # ports:
    #   - "40056:40056"
    volumes:
      - type: bind
        source: ./configs/python_chat_with_friends_system/config.py
        target: /code/src/config.py
    environment: 
      - MONGO_DB_URL=mongodb://yingshaoxo:yingshaoxo@my_mongo:27017/
      - POSTGRESQL_DB_URL=postgresql://yingshaoxo:yingshaoxo@db:5432/postgres
    restart: unless-stopped

  management_service:
    build: 
      context: ../management_system/golang_backend_service
      dockerfile: ./Dockerfile
    image: yingshaoxo/management_system/golang_backend_service
    expose:
      - "40057"
    # ports:
    #   - "40057:40057"
    # volumes:
    #   - type: bind
    #     source: ./configs/python_chat_with_friends_system/config.py
    #     target: /code/src/config.py
    environment: 
      - postgres_sql_host=db
      - postgres_sql_user=yingshaoxo
      - postgres_sql_password=yingshaoxo
      - redis_host=redis
      - redis_port=6379
      - redis_db_number=1
    restart: unless-stopped
