0

I try to run local docker environment for WhatsApp api. But when I run docker-compose it writes me that MySQL is not up yet - sleeping. I don't have MySql installed on my PC because I think that docker works smth like VM, so it will download mysql and run it. What can be a problem?

docker-compose.yml

version: '3'

volumes:
  whatsappMedia:
    driver: local
  mysqlData:
    driver: local
services:
   db:
     image: mysql:5.7.35
     restart: always
     environment:
        MYSQL_ROOT_PASSWORD: testpass
        MYSQL_USER: testuser
        MYSQL_PASSWORD: testpass
     expose:
        - "33060"
    ports:
    - "33060:3306"
volumes:
 - mysqlData:/var/lib/mysql
network_mode: bridge
cap_drop:
  - MKNOD
wacore:
 image: docker.whatsapp.biz/coreapp:v${WA_API_VERSION:-2.35.5?Run docker-compose with env var WA_API_VERSION (ex. WA_API_VERSION=2.37.1 docker-compose <command> <options>)}
command: ["/opt/whatsapp/bin/wait_on_mysql.sh", "/opt/whatsapp/bin/launch_within_docker.sh"]
volumes:
 - whatsappMedia:/usr/local/wamedia
env_file:
  - db.env
environment:
  # This is the version of the docker templates being used to run WhatsApp Business API
  WA_RUNNING_ENV_VERSION: v2.2.3
  ORCHESTRATION: DOCKER-COMPOSE
depends_on:
  - "db"
network_mode: bridge
links:
  - db
cap_drop:
  - MKNOD
waweb:
image: docker.whatsapp.biz/web:v${WA_API_VERSION:-2.35.4?Run docker-compose with env var WA_API_VERSION (ex. WA_API_VERSION=2.37.1 docker-compose <command> <options>)}
command: ["/opt/whatsapp/bin/wait_on_mysql.sh", "/opt/whatsapp/bin/launch_within_docker.sh"]
ports:
 - "9090:443"
volumes:
 - whatsappMedia:/usr/local/wamedia
env_file:
  - db.env
environment:
  WACORE_HOSTNAME: wacore
  # This is the version of the docker templates being used to run WhatsApp Business API
  WA_RUNNING_ENV_VERSION: v2.2.3
  ORCHESTRATION: DOCKER-COMPOSE
depends_on:
  - "db"
  - "wacore"
links:
  - db
  - wacore
network_mode: bridge
cap_drop:
  - MKNOD

db.env

WA_DB_ENGINE=MYSQL
WA_DB_HOSTNAME=127.0.0.1
WA_DB_PORT=3306
WA_DB_USERNAME=root
WA_DB_PASSWORD=testpass
WA_DB_CONNECTION_IDLE_TIMEOUT=180000
Exoriri
  • 327
  • 3
  • 21

1 Answers1

0

I edited the docker-compose file, I changed the version from 3 to 3.9, added a default network and deleted network_mode: bridge.

version: '3.9'

volumes:
  whatsappMedia:
    driver: local
  mysqlData:
    driver: local

networks:
  default:
    driver: bridge

services:
  db:
    image: mysql:5.7.35
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: testpass
      MYSQL_USER: testuser
      MYSQL_PASSWORD: testpass
    expose:
        - "33060"
    ports:
        - "33060:3306"
    volumes:
     - mysqlData:/var/lib/mysql
    networks:
      - default
    cap_drop:
      - MKNOD
  wacore:
    image: docker.whatsapp.biz/coreapp:v${WA_API_VERSION:?Run docker-compose with env var WA_API_VERSION (ex. WA_API_VERSION=2.39.2 docker-compose <command> <options>)}
    command: ["/opt/whatsapp/bin/wait_on_mysql.sh", "/opt/whatsapp/bin/launch_within_docker.sh"]
    volumes:
     - whatsappMedia:/usr/local/wamedia
    env_file:
      - db.env
    environment:
      # This is the version of the docker templates being used to run WhatsApp Business API
      WA_RUNNING_ENV_VERSION: v2.2.3
      ORCHESTRATION: DOCKER-COMPOSE
    depends_on:
      - db
    cap_drop:
      - MKNOD
  waweb:
    image: docker.whatsapp.biz/web:v${WA_API_VERSION:?Run docker-compose with env var WA_API_VERSION (ex. WA_API_VERSION=2.39.2 docker-compose <command> <options>)}
    command: ["/opt/whatsapp/bin/wait_on_mysql.sh", "/opt/whatsapp/bin/launch_within_docker.sh"]
    ports:
     - "9090:443"
    volumes:
     - whatsappMedia:/usr/local/wamedia
    env_file:
      - db.env
    environment:
      WACORE_HOSTNAME: wacore
      # This is the version of the docker templates being used to run WhatsApp Business API
      WA_RUNNING_ENV_VERSION: v2.2.3
      ORCHESTRATION: DOCKER-COMPOSE
    depends_on:
      - db
      - wacore
    cap_drop:
      - MKNOD
leuder
  • 1