HalcyonAzure / lsky-pro-docker

☁️兰空图床(Lsky Pro) - Docker自动构建,支持多平台
GNU Affero General Public License v3.0
272 stars 65 forks source link

docker 部署后初始化失败 #17

Closed mostcute closed 1 year ago

mostcute commented 1 year ago

SQLSTATE[HY000] [2002] Connection refused (SQL: SHOW FULL TABLES WHERE table_type = 'BASE TABLE')

version: '3'
services:
  lskypro:
    image: halcyonazure/lsky-pro-docker:latest
    restart: unless-stopped
    hostname: lskypro
    container_name: lskypro
    volumes:
      - /root/lankong/WEB:/var/www/html/
    ports:
      - "9080:80"
    networks:
      - lsky-net

  mysql-lsky:
    image: mysql:5.7.22
    restart: unless-stopped
    # 主机名,可作为"数据库连接地址"
    hostname: mysql-lsky
    # 容器名称
    container_name: mysql-lsky
    # 修改加密规则
    command: --default-authentication-plugin=mysql_native_password
    volumes:
      - /root/lankong/mysql/data:/var/lib/mysql
      - /root/lankong/mysql/conf:/etc/mysql
      - /root/lankong/mysql/log:/var/log/mysql
    environment:
      MYSQL_ROOT_PASSWORD: aaaatest # 数据库root用户密码,自行修改
      MYSQL_DATABASE: lsky-data # 可作为"数据库名称/路径"
    networks:
      - lsky-net
    ports:
      - "3306:3306"

networks:
  lsky-net: {}
mostcute commented 1 year ago

image