walle-web icon indicating copy to clipboard operation
walle-web copied to clipboard

docker 启动 msyql 初始化报错

Open baicaiit opened this issue 3 years ago • 5 comments

问题描述 [ERROR] [Entrypoint]: MYSQL_USER="root", MYSQL_USER and MYSQL_PASSWORD are for configuring a regular user and cannot be used for the root user

问题描述 docker 启动的时候 mysql没法初始化 mysql版本尝试过 8 和 5.7

截图 image

baicaiit avatar Sep 09 '21 09:09 baicaiit

解决了 文档要改一下 env那里 不能有 MYSQL_USER=root

baicaiit avatar Sep 09 '21 09:09 baicaiit

然后python 那边有需要这个参数 就会矛盾 希望优化一下

baicaiit avatar Sep 09 '21 09:09 baicaiit

image image 改成这样就ok了 不使用env_file那种形式

baicaiit avatar Sep 09 '21 11:09 baicaiit

docker-compose.yml

version: '3.7'
services:
  web:
    image: alenx/walle-web:2.1
    container_name: walle-nginx
    hostname: nginx-web
    ports:
    # 如果宿主机80端口被占用,可自行修改为其他port(>=1024)
    # 0.0.0.0:要绑定的宿主机端口:docker容器内端口80
      - "88:80"
    depends_on:
      - python
    networks:
      - walle-net
    restart: always

  python:
    image: alenx/walle-python:2.1
    container_name: walle-python
    hostname: walle-python
    env_file:
      # walle.env需和docker-compose在同级目录
      - ./walle.env
    volumes:
      - /tmp/walle/codebase/:/tmp/walle/codebase/
      - /tmp/walle/logs/:/opt/walle-web/logs/
      - /root/.ssh:/root/.ssh/
    command: bash -c "cd /opt/walle_home/ && /bin/bash admin.sh migration &&  python waller.py"
    expose:
      - "5000"
    depends_on:
      - db
    networks:
      - walle-net
    restart: always

  db:
    image: mysql:5.6
    container_name: walle-mysql
    hostname: walle-mysql
    environment:
      MYSQL_USER: "walle"
      MYSQL_PASSWORD: "walle"
      MYSQL_DATABASE: "walle"
      MYSQL_ROOT_PASSWORD: "walle"
      MYSQL_HOST: "db"
      MYSQL_PORT: "3306"
    command: [ '--default-authentication-plugin=mysql_native_password', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
    ports:
      - "3306:3306"
    expose:
      - "3306"
    volumes:
      - /data/walle/mysql:/var/lib/mysql
    networks:
      - walle-net
    restart: always

networks:
  walle-net:
    driver: bridge

tomlinux avatar Sep 24 '21 15:09 tomlinux