Skip to content

AaronDMarasco/trac-docker

 
 

Repository files navigation

trac-docker

Docker Hub

This repo is used to host a bundle to create a container based on Red Hat's UBI Fedora 31 (until trac moved to Python 3) running Trac, which is an enhanced wiki and issue tracking system for software development projects.

Trac uses a minimalistic approach to web-based software project management. It helps developers write great software while staying out of the way. Trac should impose as little as possible on a team's established development process and policies.

The author of this bundle has been using Trac on and off for about fifteen years (since around 2006 in the Trac 0.9 days).

Note: This document uses podman, but every command shown should work using the docker executable with the same options if you are using an older Fedora-based system or a non-Fedora-based Linux distribution.

Running Pre-Built Image as Container

$ podman pull docker://docker.io/admarasco/trac  # Optional but speeds up next step
$ podman run -d -p 8123:8123 --name my_trac admarasco/trac

After several seconds, you can visit the web page at http://localhost:8123

Plugins

The image has the following plugins already installed / enabled, with minimal testing:

The following are available, but not enabled in trac.ini (visit http://localhost:8123/admin/general/plugin to enable):

See below for more information on adding additional plugins.

Persistent Storage (Volume)

  • This will store the data in a volume, allowing the container to be destroyed / recreated.
  • This command line needs to change if you custom build an image using TRAC_DIR below.
  • The volume will be pre-populated on first run
  • See podman help volume for more info
$ podman run -d -p 8123:8123 --name my_trac --mount type=volume,source=trac-vol,destination=/srv/trac admarasco/trac

Exposed Apache Configuration

You can extend the above example to have all httpd configuration available in a separate volume as well:

$ podman run -d -p 8123:8123 --name my_trac --mount type=volume,source=trac-vol,destination=/srv/trac --mount type=volume,source=trac-http-conf-vol,destination=/etc/httpd/conf.d admarasco/trac

Viewing Logs

If you need to see what is happening, httpd's logs have been redirected for capture in a container-standard manner:

$ podman logs my_trac

Backing Up Data

To get a copy of the entire trac environment from a running container (named my_trac):

$ podman exec my_trac trac-admin /srv/trac/ hotcopy /tmp/backup
$ podman cp my_trac:/tmp/backup ./backup

Rebuilding Image

Build it using Dockerfile

$ git clone https://github.com/aarondmarasco/trac-docker
$ cd trac-docker
$ podman build -t trac ./
# OR
$ podman build --build-arg TRAC_PROJECT_NAME="My Super Awesome Trac Project" -t trac ./

Image Build-Time Arguments

WARNING: Persistent storage will likely break if you change these after creating a volume.

  • TRAC_ADMIN_NAME (default is trac_admin):

    the admin username of Trac

  • TRAC_ADMIN_PASSWD (default is passw0rd):

    the admin password of Trac

  • TRAC_PROJECT_NAME (default is trac_project):

    the Trac project name

  • TRAC_DIR (default is /srv/trac):

    This directory stores all the data and configurations. You can bind a volume when starting a container.

  • TRAC_INI (default is $TRAC_DIR/conf/trac.ini):

    This ini file will be automatically generated by the container. Also you can make some customizations based on your needs. (This guide assumes you know how to copy out.)

  • DB_LINK (default is sqlite:db/trac.db):

    A database system is needed. The database can be one of: SQLite, PostgreSQL or MySQL.

    Please refer https://trac.edgewall.org/wiki/TracInstall#MandatoryDependencies for more detailed infomation.

    • For the PostgreSQL database

      See DatabaseBackend for details.

    • For the MySQL database

      Trac works well with MySQL. Given the caveats and known issues surrounding MySQL, read the MySqlDb page before creating the database.

Adding Plugins

One of Trac's draws are the plethora of plugins available on Trac-Hacks. To add your own, you will need to edit the Dockerfile (to get them into the image) as well as trac_setup.sh (to configure trac.ini, etc). Both files have examples to help you along.

Once they've been built, they are copied into /container_info/ within the image, e.g. TracTags-0.12.dev0-py2.7.egg as well as under the plugins directory of the example project. If you already have a project using external volumes (as noted above), you will need to copy the *.egg for your plugins into your existing project(s).

Misc Apache Configuration

This container image is powered by Apache Web Server.

You can make your own customizations (such as adding TLS, etc.) in ./trac.conf and map to /etc/httpd/conf.d/trac.conf when starting a container.

$ podman run -d -p 8123:8123 -v ./trac.conf:/etc/httpd/conf.d/trac.conf --name my_trac admarasco/trac

To extract the trac.conf customized by the build process, use podman cp to copy out /etc/httpd/conf.d/trac.conf .

Reference

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 57.7%
  • Shell 42.3%