如何使用WhatsApp Business API访问wacore容器

问题描述 投票:0回答:1

我最近开始使用WhatsAppBusiness API,我能够为whatsappbusiness安装docker容器,并且我能够使用端口9090访问whatsapp web。例如:https://172.29.208.1:9090

但我不知道如何访问MySQL和WhatsAppCore应用程序。

我试过http://172.29.208.1:33060但没有发生任何事情。请让我知道如何访问MySQL和wacore。

这是我的docker-compose.yml文件

泊坞窗,compose.yml

version: '3'

volumes:
  whatsappData:
    driver: local
  whatsappMedia:
    driver: local

services:
  db:
    image: mysql:5.7.22
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: testpass
      MYSQL_USER: testuser
      MYSQL_PASSWORD: testpass
    expose:
        - "33060"
    ports:
        - "33060:3306"
    network_mode: bridge
  wacore:
    image: docker.whatsapp.biz/coreapp:v2.19.4
    command: ["/opt/whatsapp/bin/wait_on_mysql.sh", "/opt/whatsapp/bin/launch_within_docker.sh"]
    volumes:
     - whatsappData:/usr/local/waent/data
     - whatsappMedia:/usr/local/wamedia
    env_file:
      - db.env
    depends_on:
      - "db"
    network_mode: bridge
    links:
      - db
  waweb:
    image: docker.whatsapp.biz/web:v2.19.4
    command: ["/opt/whatsapp/bin/wait_on_mysql.sh", "/opt/whatsapp/bin/launch_within_docker.sh"]
    ports:
     - "9090:443"
    volumes:
     - whatsappData:/usr/local/waent/data
     - whatsappMedia:/usr/local/wamedia
    env_file:
      - db.env
    environment:
      WACORE_HOSTNAME: wacore
    depends_on:
      - "db"
      - "wacore"
    links:
      - db
      - wacore
    network_mode: bridge
docker-compose whatsapp
1个回答
1
投票

Mysql不是HTTP服务器,它不了解http://172.29.208.1:33060

你可以运行'docker ps | grep mysql'获取mysql容器ID

8dfa30ab0200 mysql:5.7.22“docker-entrypoint.s ...”6分钟前上传6分钟33060 / tcp,0.0.0.0:33060->3306 / tcp xxxx_db_1

然后运行'docker exec -it 8dfa30ab0200 mysql -h localhost -P 3306 -u testuser --password = testpass'来访问mysql

但是因为你没有注册,所以你不会在mysql中看到太多东西。请按照https://developers.facebook.com/docs/whatsapp/api/account中的步骤进行注册。

您无需直接访问coreapp,您可以通过webapp(https://172.29.208.1:9090)执行所有API请求。

© www.soinside.com 2019 - 2024. All rights reserved.