Docker Compose部署MantisBT
文章目录
- 1.docker-compose-mantisbt.yml
- 2.部署
- 3.配置MantisBT
- 4.登录
- 5.修改配置
- 5.1 取消修改用户需要邮箱确认
1.docker-compose-mantisbt.yml
version: "3"
services:
web:
image: okainov/mantisbt:latest
container_name: mantisbt_web
ports:
- "8989:80"
environment:
# Comment or set to 0 in production!
- MANTIS_ENABLE_ADMIN=1
# Set master salt, typically can be generated by `cat /dev/urandom | head -c 64 | base64`
- MASTER_SALT=AlqUymmxxkDOXgAp/5Uwm+Uhf1MH9jOk0K/nSvFgrxYZcPGEsnjG29jdYXoOQnclBBaxk3OE5Um8D2qRkKuiFQ==
# Set base email settings. For more detailed configuration (i.e. SMTP) you'll need to add own config file
- EMAIL_WEBMASTER=webmaster@localhost
- EMAIL_FROM=webmaster@localhost
- EMAIL_RETURN_PATH=webmaster@localhost
# Uncomment only if modified from default values
- MYSQL_HOST=db
- MYSQL_DATABASE=mantisbt
- MYSQL_USER=mantisbt
- MYSQL_PASSWORD=mantisbt
# If you need to customize more options in config, create `config_inc_addon.php` and uncomment lines below
# This file will be included from the main config.
volumes:
- mantisbt_data:/var/www/html
depends_on:
- db
restart: always
db:
image: mariadb:10.7.8
container_name: mantisbt_db
volumes:
- mariadb_data:/var/lib/mysql
environment:
# You might want to change root password before first run
- MARIADB_ROOT_PASSWORD=root
- MARIADB_DATABASE=mantisbt
- MARIADB_USER=mantisbt
- MARIADB_PASSWORD=mantisbt
# Set default collation so Mantis does not complain about latin1
command: ['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
volumes:
mariadb_data:
mantisbt_data:
2.部署
docker compose -f docker-compose-mantisbt.yml up -d
3.配置MantisBT
# 访问:
http://192.168.120.19:8989/
# 点击
Install/Upgrade Database
4.登录
# 登录
http://192.168.120.19:8989/
默认用户名:administrator
默认密码:root
5.修改配置
5.1 取消修改用户需要邮箱确认
# 修改配置
vim /var/lib/docker/volumes/root_mantisbt_data/_data/config_defaults_inc.php
# 修改项
$g_send_reset_password = OFF;
# 不重建已存在的容器,但会重新创建更改过的配置或镜像的容器
docker compose -f docker-compose-mantisbt.yml up -d --no-recreate
创建用户名:mantisbt
创建密码:mantisbt
使用mantisbt用户登录,成功