GithubHelp home page GithubHelp logo

okainov / mantisbt-docker Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 9.0 27 KB

Docker image for Mantis Bug Tracker https://www.mantisbt.org/

License: MIT License

Dockerfile 68.38% PHP 23.03% Shell 8.59%
mantisbt docker bug-tracker bugtracker php docker-image docker-compose hacktoberfest

mantisbt-docker's Introduction

CI Docker Image Size (latest by date) Docker Pulls

MantisBT bug tracker Docker image

Docker image for Mantis Bug Tracker https://www.mantisbt.org/

Why this image?

There are some other alternative images exist already such as vimagick/mantisbt, xlrl/docker-mantisbt and a few others. Why do we need yet another image?

The reason is to combine all the useful features they have and add some missing ones. To list some:

  • Always latest MantisBT version.
  • Comes with the latest PHP version (7.4 as for today)
  • Allows to easily configure presence of admin service folder
  • Comes with built-in integration with Gitlab and Github source plugins
  • Example docker-compose.yml file provided for getting started in one click!
  • Easy customization of the config files and custom plugins without destroying data from base image
  • Consistent Dockerfile style following all best practices (ensured by Dockerfile lint)

Quick start

  • Download docker-compose.yml from this repo: wget https://raw.githubusercontent.com/okainov/mantisbt-docker/master/docker-compose.yaml
  • Check the environment variables (at least you need to set MASTER_SALT env variable, doc)
  • docker-compose up -d
  • Open browser at localhost:8989/admin/install.php and follow installation instructions, default out-of-the-box values are good to use. -- Ignore Config File Exists but Database does not warning and proceed installation
  • 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)
  • 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) and "folder outside of web root" warnings (#21584))
  • 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.

For further details refer to official documentation

Example docker-compose.yml

version: "3"

services:
  web:
    # Pin the version for production usage!
    image: okainov/mantisbt:latest
    container_name: mantis_web
    ports:
      - "8989:80"
    environment:
      - MANTIS_ENABLE_ADMIN=1
      # Set master salt, typically can be generated by `cat /dev/urandom | head -c 64 | base64`
      #- MASTER_SALT=
      # 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=bugtracker
      #- MYSQL_USER=mantis
      #- MYSQL_PASSWORD=mantis
    depends_on:
      - db
    restart: always

  db:
    image: mysql:5.7
    container_name: mantis_db
    volumes:
      - ./db_data:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_DATABASE=bugtracker
      - MYSQL_USER=mantis
      - MYSQL_PASSWORD=mantis
    command: ['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']

Extensions

Custom config settings

If 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.

Some of the typical settings you might want to change:

$g_window_title = 'Title of your MantisBT instance';

// Default is useless 5 minutes
$g_reauthentication_expiry = 60 * 60;

// Increase upload file size from default 5MB
$g_max_file_size = 5 * 1024 * 1024;

// Enable anonymous access

$g_allow_anonymous_login = true;
$g_anonymous_account = 'anonymous';

Email

There are following env variables supported:

  • EMAIL_WEBMASTER - maps to g_webmaster_email
  • EMAIL_FROM - maps to g_from_email
  • EMAIL_RETURN_PATH - maps to g_return_path_email

Those are good enough to start with. Going further, to configure SMTP you might need to create custom config (as described above) with the values like:

$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'mail.domain.com';
$g_smtp_username = '[email protected]';
$g_smtp_password = 'FILLME';

More details are available in official documentation

Custom plugins

In 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/

mantisbt-docker's People

Contributors

okainov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mantisbt-docker's Issues

How do backup?

Hey how can i do backup of data? Is there a command that will generate a archive for me?

File Upload is 0

When using this Docker image, the File-Upload size is 0, thus mantis does not allow to upload a file.
I assume this is caused by PHP.ini, is there a way to set this value via configuration?

Change Mantis Version that is being installed

Hi there,
thank you for this amazing image. It worked the best out of all the images I tried.

I got a scenario where I need to specify the Mantis Version that is being installed, instead of using the newest version. Is there way to add it to the compose file as an optional parameter or something?

Thank you.

Update to 2.25.1

Hello,
you did a great job with those images, thank you really much!
Could it be possible to update mantisbt from 2.24.4 to 2.25.1.
a lot of debug and security issue fix has been done in 2.25.0+ and it would be great to have those.
Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.