{"id":21134247,"url":"https://github.com/okainov/mantisbt-docker","last_synced_at":"2025-07-09T02:32:14.231Z","repository":{"id":38790543,"uuid":"264641101","full_name":"okainov/mantisbt-docker","owner":"okainov","description":"Docker image for Mantis Bug Tracker https://www.mantisbt.org/","archived":false,"fork":false,"pushed_at":"2022-06-02T21:37:40.000Z","size":27,"stargazers_count":12,"open_issues_count":2,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-03-25T05:20:32.760Z","etag":null,"topics":["bug-tracker","bugtracker","docker","docker-compose","docker-image","hacktoberfest","mantisbt","php"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/okainov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-17T10:46:49.000Z","updated_at":"2024-02-16T18:51:18.000Z","dependencies_parsed_at":"2022-08-25T09:41:53.118Z","dependency_job_id":null,"html_url":"https://github.com/okainov/mantisbt-docker","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okainov%2Fmantisbt-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okainov%2Fmantisbt-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okainov%2Fmantisbt-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okainov%2Fmantisbt-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/okainov","download_url":"https://codeload.github.com/okainov/mantisbt-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225478092,"owners_count":17480581,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bug-tracker","bugtracker","docker","docker-compose","docker-image","hacktoberfest","mantisbt","php"],"created_at":"2024-11-20T06:25:43.385Z","updated_at":"2025-07-09T02:32:14.224Z","avatar_url":"https://github.com/okainov.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![CI](https://github.com/okainov/mantisbt-docker/workflows/CI/badge.svg?branch=master)](https://github.com/okainov/mantisbt-docker/actions) [![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/okainov/mantisbt)](https://hub.docker.com/r/okainov/mantisbt) [![Docker Pulls](https://img.shields.io/docker/pulls/okainov/mantisbt)](https://hub.docker.com/r/okainov/mantisbt)\n\n# MantisBT bug tracker Docker image\n\nDocker image for Mantis Bug Tracker https://www.mantisbt.org/\n\n# Why this image?\n\nThere are some other alternative images exist already such as [vimagick/mantisbt](https://hub.docker.com/r/vimagick/mantisbt/), [xlrl/docker-mantisbt](https://github.com/xlrl/docker-mantisbt) and a few others. Why do we need yet another image?\n\nThe reason is to combine all the useful features they have and add some missing ones. To list some:\n\n- Always latest MantisBT version.\n- Comes with the latest PHP version (8.4 as for today)\n- Allows to easily configure presence of `admin` service folder\n- Comes with built-in integration with Gitlab and Github [source plugins](https://github.com/mantisbt-plugins/source-integration)\n- Example `docker-compose.yml` file provided for getting started in one click!\n- Easy customization of the config files and custom plugins without destroying data from base image\n- Consistent Dockerfile style following all best practices (ensured by Dockerfile lint)\n\n\n# Quick start\n\n- Download `docker-compose.yml` from this repo: `wget https://raw.githubusercontent.com/okainov/mantisbt-docker/master/docker-compose.yaml`\n- Check the environment variables (at least you need to set MASTER_SALT env variable, [doc](\nhttps://www.mantisbt.org/docs/master/en-US/Admin_Guide/html-desktop/#admin.config.security))\n- `docker-compose up -d`\n- Open browser at `localhost:8989/admin/install.php` and follow installation instructions, default out-of-the-box values are good to use.\n-- Ignore `Config File Exists but Database does not` warning and proceed installation\n- Log in as `administrator`/`root` (default credentials) and confugre whatever you need (typically you want to create your own Admin user and disable built-in \"administrator\" first)\n- Check MantisBT own's checks at `localhost:8989/admin/`. Note: several warnings are expected to be \"WARN\" due to issues in MantisBT, such as magic quotes warning ([#26964](https://www.mantisbt.org/bugs/view.php?id=26964)) and \"folder outside of web root\" warnings ([#21584](https://mantisbt.org/bugs/view.php?id=21584)))\n- When ready to move to production, either remove `MANTIS_ENABLE_ADMIN` env variable or set it to 0 - this will remove \"admin\" folder from the installation.\n\nFor further details refer to [official documentation](https://www.mantisbt.org/docs/master/en-US/Admin_Guide/html-desktop/#admin.install.new)\n\n## Example docker-compose.yml\n\n```YAML\nversion: \"3\"\n\nservices:\n  web:\n    # Pin the version for production usage!\n    image: okainov/mantisbt:latest\n    container_name: mantis_web\n    ports:\n      - \"8989:80\"\n    environment:\n      - MANTIS_ENABLE_ADMIN=1\n      # Set master salt, typically can be generated by `cat /dev/urandom | head -c 64 | base64`\n      #- MASTER_SALT=\n      # Set base email settings. For more detailed configuration (i.e. SMTP) you'll need to add own config file\n      - EMAIL_WEBMASTER=webmaster@localhost\n      - EMAIL_FROM=webmaster@localhost\n      - EMAIL_RETURN_PATH=webmaster@localhost\n      # SMTP Settings, below are default values\n      #- SMTP_HOST=smtp.yourmail.com\n      #- SMTP_USER=username\n      #- SMTP_PASSWORD=superstrongpassword\n      #- SMTP_PORT=587\n      #- SMTP_MODE=tls # Maps to $g_smtp_connection_mode, defaults to tls, can be ssl or empty\n      # Uncomment only if modified from default values\n      #- MYSQL_HOST=db\n      #- MYSQL_DATABASE=bugtracker\n      #- MYSQL_USER=mantis\n      #- MYSQL_PASSWORD=mantis\n    depends_on:\n      - db\n    restart: always\n\n  db:\n    image: mysql:8.4\n    container_name: mantis_db\n    volumes:\n      - ./db_data_v8:/var/lib/mysql\n    environment:\n      - MYSQL_ROOT_PASSWORD=root\n      - MYSQL_DATABASE=bugtracker\n      - MYSQL_USER=mantis\n      - MYSQL_PASSWORD=mantis\n    command: ['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']\n\n```\n\n## Upgrading\n\nNormally, you should be able to upgrade freely without any restrictions, just make sure to run the compose with `MANTIS_ENABLE_ADMIN=1` after updating the versions and go to `your-mantis-instance/admin` to perform database upgrades when needed. That's all :)\n\n### MySQL 5.7 EOL\n\n`docker-compose.yaml` file before May 2025 in this repo was using `mysql:5.7` as database container. This has became EOL in 2023, so it was updated to current LTS version 8.4. Unfortunately [MySQL does NOT support direct upgrade](https://dev.mysql.com/doc/refman/8.4/en/upgrade-paths.html), so the recommended way is to just backup the database, upgrade the version and set new path for `db_data`, then recreate the database from dump.\n\n```\n# Backup first anyway\ndocker exec mantis_db /usr/bin/mysqldump -u root -proot bugtracker \u003e backup.sql\ndocker compose down\n# Change 5.7-\u003e8.4 and either update db_data mount path e.g. to db_data_v8 or rename db_data-\u003edb_data.old\ndocker compose up -d\n\ndocker cp backup.sql mantis_db:/backup.sql\ndocker exec -it mantis_db bash\n# Inside container\nmysql -u root -p bugtracker \u003c /backup.sql\n\n# Test the instance, check /admin, if all good - set MANTIS_ENABLE_ADMIN=0 and enjoy\n\n```\n\n# Extensions\n\n## Custom config settings\n\nIf you need to customize more options in config, create `config_inc_addon.php` file and mount it to `/var/www/html/config/config_inc_addon.php` in container. This fill will be added to default `config_inc.php`. Mounting it will allow you to see the changes instantly without rebuilding/restarting the container.\n\nSome of the typical settings you might want to change:\n\n```\n$g_window_title = 'Title of your MantisBT instance';\n\n// Default is useless 5 minutes\n$g_reauthentication_expiry = 60 * 60;\n\n// Increase upload file size from default 5MB\n$g_max_file_size = 5 * 1024 * 1024;\n\n// Enable anonymous access\n\n$g_allow_anonymous_login = true;\n$g_anonymous_account = 'anonymous';\n\n```\n\n## Email\n\nThere are following env variables supported:\n\n- `EMAIL_WEBMASTER` - maps to `g_webmaster_email`\n- `EMAIL_FROM` - maps to `g_from_email`\n- `EMAIL_RETURN_PATH` - maps to `g_return_path_email`\n- `EMAIL_FROM_NAME` - maps to `$g_from_name`\n\nAlso SMTP env variables are supported as well:\n\n- `SMTP_HOST=smtp.yourmail.com`\n- `SMTP_USER=username`\n- `SMTP_PASSWORD=superstrongpassword`\n- `SMTP_PORT=587`\n- `SMTP_MODE=tls` - Maps to $g_smtp_connection_mode, defaults to tls, can be ssl or empty\n  ```\n\nThose are good enough to start with. Going further, to configure more details you might need to create custom config (as described above) with the values like those:\n```\n$g_phpMailer_method = PHPMAILER_METHOD_SMTP;\n$g_smtp_host = 'mail.domain.com';\n$g_smtp_username = 'mail@domain.com';\n$g_smtp_password = 'FILLME';\n```\n\nMore details are available in [official documentation](https://www.mantisbt.org/docs/master/en-US/Admin_Guide/html-desktop/#admin.config.email)\n\n## Custom plugins\n\nIn order to add your own custom plugins into the image, either create your own Dockerfile and copy extra plugins to `/var/www/html/plugins/` or add volume in docker-compose to mount extra plugin directly inside existing image `./custom_plugin/:/var/www/html/plugins/custom_plugin/`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokainov%2Fmantisbt-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fokainov%2Fmantisbt-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokainov%2Fmantisbt-docker/lists"}