From f85ac7f724f1ee786576c5d02a1cef9d1610e757 Mon Sep 17 00:00:00 2001 From: zhaoyihao Date: Fri, 25 Oct 2024 15:35:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86docker-compose?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E5=AE=B9=E5=99=A8=E7=9A=84=E5=8A=9E=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/README.md b/README.md index 8395914..fec5066 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,67 @@ docker run --name dnsmgr -dit -p 8081:80 -v /var/dnsmgr:/app/www netcccyun/dnsmg docker restart dnsmgr ``` +### docker-compose部署方法 + +``` +version: '3' +services: + dnsmgr-web: + container_name: dnsmgr-web + stdin_open: true + tty: true + ports: + - 8081:80 + volumes: + - /volume1/docker/dnsmgr/web:/app/www + image: netcccyun/dnsmgr + depends_on: + - dnsmgr-mysql + networks: + - dnsmgr-network + + dnsmgr-mysql: + container_name: dnsmgr-mysql + restart: always + ports: + - 3306:3306 + volumes: + - ./mysql/conf/my.cnf:/etc/mysql/my.cnf + - ./mysql/logs:/logs + - ./mysql/data:/var/lib/mysql + environment: + - MYSQL_ROOT_PASSWORD=123456 + - TZ=Asia/Shanghai + image: mysql:5.7 + networks: + - dnsmgr-network + +networks: + dnsmgr-network: + driver: bridge +``` + +在运行之前请创建好目录 +``` +mkdir -p ./web +mkdir -p ./mysql/conf +mkdir -p ./mysql/logs +mkdir -p ./mysql/data + +vim mysql/conf/my.cnf +[mysqld] +sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION +``` + +登陆mysql容器创建数据库 +``` +docker exec -it dnsmgr-mysql /bin/bash +mysql -uroot -p123456 +create database dnsmgr; +``` + +在install界面链接IP填写dnsmgr-mysql + ### 版权信息 版权所有Copyright © 2023~2024 by 消失的彩虹海(https://blog.cccyun.cn)