Docker image for bugzilla web server.
Container runs as non-root user. This user owns bugzilla process and owns bugzilla files.
To run container next volumes should be mapped:
- folder for SQL database
- folder for bugzilla files
- logs folder
- backups folder
- Pull docker image.
- Create user and group to own bugzilla files and to run docker container:
sudo groupadd -g 967 bugzilla
useradd -u 967 -g 967 -M bugzilla
- Proceed to configuration.
- Pull project sources from version control system.
- Create user and group to own bugzilla files and to run docker container:
sudo useradd -r bugzilla
- Make build executable:
sudo chmod u+x ./build
- Execute build:
sudo ./build bugzilla
- Proceed to configuration.
- Create folders for bugzilla files:
sudo mkdir /bugzilla
sudo mkdir /bugzilla/db
sudo mkdir /bugzilla/data
- Create folder for logs:
sudo mkdir /var/log/bugzilla
- Create folder for backups:
sudo mkdir /var/backups/bugzilla
- Grant permit to all folders:
sudo chown -R bugzilla:bugzilla /bugzilla
sudo chown bugzilla:bugzilla /var/log/bugzilla
sudo chown bugzilla:bugzilla /var/backups/bugzilla
- Copy etc/init.d/bugzilla to /etc/init.d folder:
sudo cp ./etc/init.d/bugzilla /etc/init.d
- Copy usr/sbin/bugzilla to /usr/sbin folder:
sudo cp ./usr/sbin/bugzilla /usr/sbin
- Copy usr/bin/bgutil to /usr/bin folder:
sudo cp ./usr/bin/bgutil /usr/bin
- Make all files executable:
sudo chmod a+x /etc/init.d/bugzilla
sudo chmod a+x /usr/sbin/bugzilla
sudo chmod a+x /usr/bin/bgutil
- Register service:
sudo update-rc.d bugzilla defaults
- Specify database root password in /usr/sbin/bugzilla file:
docker run ... -e DB_ROOT_PASSWORD="<some_password>" ...
- Specify bugzilla database user password in /usr/sbin/bugzilla file:
docker run ... -e DB_USER_PASSWORD="<some_password>" ...
- Start bugzilla service:
sudo service bugzilla start
- Initialize bugzilla database:
Specify the following information:
sudo bgutil initialize
- administrator e-mail
- administrator name
- administrator password
- administrator password confirmation
- Restart bugzilla service:
sudo service bugzilla restart
sudo service bugzilla (start|stop|status|restart)
sudo bgutil backup <filename>
Backup file /var/backups/bugzilla/<filename>.tar.gz will be created.
sudo bgutil restore <filename>
sudo bgutil bash
Bugzilla web server can be located with another web applications. For example, mercurial, bugzilla, wiki etc can be run as docker containers on the same host. In this case apache server can be used to redirect requests to different docker containers.
- Enable apache mod_proxy:
sudo a2enmod deflate headers proxy proxy_ajp proxy_balancer proxy_connect proxy_html proxy_http rewrite
- Configure proxy:
<VirtualHost *:80> ... ProxyPreserveHost On <Proxy *> Order allow,deny Allow from all </Proxy> ... </VirtualHost>
- Copy ./etc/apache2/sites-available/bugzilla.conf to /etc/apache2/sites-available folder:
sudo cp ./etc/apache2/sites-available/bugzilla.conf /etc/apache2/sites-available
- Enable apache sites:
sudo a2ensite bugzilla
- Restart apache service:
sudo service apache2 restart
- Stop bugzilla service:
sudo service bugzilla stop
- Specify new database root password in /usr/sbin/bugzilla file:
docker run ... -e DB_ROOT_PASSWORD="<new_password>" ...
- Start bugzilla service:
sudo service bugzilla start
- Run the following command:
sudo bgutil changeRootPassword "<old_password>"
- Stop bugzilla service:
sudo service bugzilla stop
- Specify new bugzilla database user password in /usr/sbin/bugzilla file:
docker run ... -e DB_USER_PASSWORD="<new_password>" ...
- Start bugzilla service:
sudo service bugzilla start
- Run the following command
sudo bgutil changeUserPassword
Special characters should be escaped:
docker run ... -e DB_ROOT_PASSWORD="pa\$\$word" ...
docker run ... -e DB_USER_PASSWORD="pas\$11" ...
sudo crontab -l | { cat; echo "minute hour * * * /usr/bin/bgutil backup <filename>"; echo ""; } | sudo crontab -
If you find my code useful, you can bye me a coffee