yearning docker 部署

big_cat發表於2023-02-25

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

相關文章