一、创建目录
mkdir /docker/kodbox && cd /docker/kodbox
二、创建数据库环境变量
vim db.env MYSQL_PASSWORD=123456 MYSQL_DATABASE=kodbox MYSQL_USER=kodbox MARIADB_ROOT_PASSWORD=123456 MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=123456 MARIADB_RANDOM_ROOT_PASSWORD=123456
三、创建docker-compose.yml
version: '3.5' services: db: image: mariadb:10.6 restart: always command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW volumes: - "./db:/var/lib/mysql" #./db是数据库持久化目录,可以修改 # - "./etc/mysql/conf.d:/etc/mysql/conf.d" #增加自定义mysql配置 environment: - MYSQL_ROOT_PASSWORD=123456 - MARIADB_AUTO_UPGRADE=1 - MARIADB_DISABLE_UPGRADE_BACKUP=1 env_file: - db.env app: image: kodcloud/kodbox restart: always ports: - 8091:80 #左边80是使用端口,可以修改 volumes: - "./site:/var/www/html" #./site是站点目录位置,可以修改 environment: - MYSQL_HOST=db - REDIS_HOST=redis env_file: - db.env depends_on: - db - redis redis: image: redis:alpine restart: always onlyoffice: image: kodcloud/kodoffice:7.4.1.1 restart: always ports: - 8090:80
标签:kodbox,onlyoffice,MYSQL,db,MARIADB,docker,123456,可道,PASSWORD From: https://www.cnblogs.com/raorao1994/p/17924588.html