yearning docker 部署

yearning 是一款 sql 审核平台,界面和功能都还不错,推荐 2.3.5 版本。

docker-composer.yml

version: '3'

services:
    yearning:
        image: chaiyd/yearning:v2.3.5
        container_name: yearning
        environment:
           MYSQL_USER: yearning
           MYSQL_PASSWORD: ukC2ZkcG_ZTeb
           MYSQL_ADDR: yearning-mysql
           MYSQL_DB: yearning
           SECRET_KEY: dbcjqheupqjsuwsm
           IS_DOCKER: is_docker
        ports:
           - 8889:8000
        # 首次使用请先初始化
        command: /bin/bash -c "./Yearning install && ./Yearning run"
        links:
           - yearning-mysql
        depends_on:
           - yearning-mysql
        restart: always

    yearning-mysql:
        image: mysql:5.7
        container_name: yearning-mysql
        environment:
           MYSQL_ROOT_PASSWORD: ukC2ZkcG_ZTeb
           MYSQL_DATABASE: yearning
           MYSQL_USER: yearning
           MYSQL_PASSWORD: ukC2ZkcG_ZTeb
        command:
           - --character-set-server=utf8mb4
           - --collation-server=utf8mb4_general_ci
        volumes:
           - ./data/mysql:/var/lib/mysql

# 默认账号:admin,默认密码:Yearning_admin

yearning 依赖 mysql,这里创建一个 mysqlyearning 单独使用,如果你有本地或其他容器 mysql 也可以修改 yearningMYSQL_* 配置链接

mkdir /opt/yearning && cd /opt/yearning

# 创建并启动容器
docker-compose up -d

# 查看容器运行状态
docker-compose ps

你可能感兴趣的:(mysqlsql)