How to install MantisBT in Docker container?
Here is my file for Docker-Compose (docker-compose.yaml):
Code: Select all
services:
mantisbt:
image: xlrl/mantisbt
environment:
MANTIS_ENABLE_ADMIN: 1
PHP_DISPLAY_ERRORS: 1
PHP_DISPLAY_STARTUP_ERRORS: 1
PHP_ERROR_REPORTING: 'E_ALL'
PHP_LOG_ERRORS: 1
PHP_ERROR_LOG: /var/www/html/config/php_errors.log
ports:
- "8989:80"
links:
- mysql
depends_on:
- mysql
networks:
- mantis_net
volumes:
- ./config:/var/www/html/config
- ./custom:/var/www/html/custom
- ./plugins:/var/www/html/plugins
- ./log:/var/log/mantis
- /tmp/mantis:/tmp/mantis
restart: always
mysql:
image: ubuntu/mysql
environment:
- MYSQL_ROOT_PASSWORD=mysecretpasswd2
- MYSQL_DATABASE=bugtracker
- MYSQL_USER=amantisuser
- MYSQL_PASSWORD=mysecretpasswd
volumes:
- ./mysql:/var/lib/mysql
networks:
- mantis_net
restart: always
networks:
mantis_net:
driver: bridge
Code: Select all
<?php
$g_hostname = 'my.site.org';
$g_db_type = 'mysqli';
$g_database_name = 'bugtracker';
$g_db_username = 'amantisuser';
$g_db_password = 'mysecretpasswd';
$g_default_timezone = 'UTC';
$g_crypto_master_salt = 'BRTyArGi77odpU08rLw8t1LTphLw4Q8ILa5Daq5D7oM=';
$g_path = '';
docker-compose up
Both containers work:
I set up a proxy server (Nginx):a9827770da74 xlrl/mantisbt "/bin/sh -c /usr/loc…" 4 hours ago Up 26 minutes 0.0.0.0:8989->80/tcp, :::8989->80/tcp mantisbt-mantisbt-1
b4b26cb64492 ubuntu/mysql "docker-entrypoint.s…" 4 hours ago Up 26 minutes 3306/tcp, 33060/tcp mantisbt-mysql-1
Code: Select all
server {
server_name my.site.org;
location / {
proxy_pass http://localhost:8989;
}
But when I go to my site, I see this:
What am I doing wrong?APPLICATION ERROR #400
Connection to the database failed. Error received - #2002: Connection refused.
Thank you.