Mac上安装瓦力之Docker安装的一些小坑

mac电脑 docker安装瓦力,docker-compose.yml和官方不同的地方,其他按照官方的即可

# docker version:  18.06.0+
# docker-compose version: 1.23.2+
# OpenSSL version: OpenSSL 1.1.0h
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
    #第一个不同:端口填8081
      - "8081: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在同级目录
      #第二个不同:.ssh 位置不一样,需要填自己mac电脑.ssh的位置
      - ./walle.env
    volumes:
      - /Users/imacbook/Desktop/docker/walle-web/walle/plugins/:/opt/walle_home/plugins/
      - /Users/imacbook/Desktop/docker/walle-web/walle/codebase/:/tmp/walle/codebase/
      - /Users/imacbook/Desktop/docker/walle-web/walle/logs/:/opt/walle-web/logs/
      - /Users/imacbook/.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
    container_name: walle-mysql
    hostname: walle-mysql
    env_file:
      # walle.env需和docker-compose在同级目录
      # 第三个不同 mysql端口填写3307
      # 第四个不同需要添加默认的mysql密码,不然连不上mysql,第一次会连不上,需要第二次docker-compose up
      - ./walle.env
    command: [ '--default-authentication-plugin=mysql_native_password', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
    environment:
      - MYSQL_ROOT_PASSWORD=walle
      - MYSQL_PASSWORD=walle
      - MYSQL_USER=root
      - MYSQL_DATABASE=walle
    ports:
      - "3307:3306"
    expose:
      - "3306"
    volumes:
      - /Users/imacbook/Desktop/docker/walle-web/walle/mysql:/var/lib/mysql
    networks:
      - walle-net
    restart: always

networks:
  walle-net:
    driver: bridge
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值