如何使用WhatsApp Business API访问Wacore容器 [英] How to access wacore container using WhatsApp Business API
问题描述
我最近开始使用WhatsAppBusiness API,能够为whatsappbusiness安装docker容器,并且能够使用端口9090访问whatsapp Web.例如: https://172.29.208.1:9090
I recently started using WhatsAppBusiness API, i am able to install the docker containers for whatsappbusiness and i am able to access whatsapp web using the port 9090. Ex: https://172.29.208.1:9090
但是我不知道如何访问MySQL和WhatsAppCore应用.
But I don't know how to access MySQL and WhatsAppCore app.
我尝试了 http://172.29.208.1:33060 ,但没有任何反应.请让我知道如何访问MySQL和wacore.
I tried http://172.29.208.1:33060 but nothing is happened. Please let me know how to access MySQL and wacore.
这是我的docker-compose.yml文件
Here is my docker-compose.yml file
docker-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
推荐答案
Mysql不是HTTP服务器,它不理解 http://172.29.208.1:33060
Mysql is not a HTTP server, it doesn't understand http://172.29.208.1:33060
您可以运行'docker ps |grep mysql'以获取mysql容器ID
you could run 'docker ps | grep mysql' to get mysql container id
8dfa30ab0200 mysql:5.7.22"docker-entrypoint.s…" 6分钟前向上6分钟33060/tcp,0.0.0.0:33060->3306/tcp xxxx_db_1
8dfa30ab0200 mysql:5.7.22 "docker-entrypoint.s…" 6 minutes ago Up 6 minutes 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
then run 'docker exec -it 8dfa30ab0200 mysql -h localhost -P 3306 -u testuser --password=testpass' to access mysql
但是因为您还没有注册,所以您不会在mysql中看到很多东西.请按照 https://developers.facebook.com/docs/whatsapp/api/中的步骤操作帐户以执行注册.
But because you haven't registered, you won't see much stuffs in mysql. Please follow steps in https://developers.facebook.com/docs/whatsapp/api/account to perform registration.
您不需要直接访问coreapp,您可以通过webapp执行所有API请求( https://172.29.208.1:9090 ).
You don't need to access coreapp directly, you perform all API requests through webapp (https://172.29.208.1:9090).
这篇关于如何使用WhatsApp Business API访问Wacore容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!