Skip to content

dixudx/trac-docker

Repository files navigation

trac-docker

Docker Hub

This repo builds a Docker container (based on Alpine Linux) 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.

How to get the image

  • Build it using Dockerfile

    $ git clone https://github.com/dixudx/trac-docker
    $ cd trac-docker
    $ docker build -t trac ./
    
  • just pull it from Dockerhub

    $ docker pull stephenhsu/trac
    

How to run the container

Quick Start

$ docker run -d -p 8123:8123 \
    -e TRAC_ADMIN_PASSWD=change-me \
    -v trac-data:/var/local/trac \
    --name my_trac stephenhsu/trac

TRAC_ADMIN_PASSWD is required on first run — the container bootstraps the Trac environment, deploys static assets, and creates the admin user on first start. On subsequent starts the env is reused from the volume and the password env var is ignored. Mount a named volume at /var/local/trac to persist data.

After several seconds, visit http://localhost:8123 and log in as trac_admin / <TRAC_ADMIN_PASSWD>.

Environment Variables Explanations

Most of below

  • TRAC_ADMIN_NAME (default is trac_admin):

    the admin username of Trac

  • TRAC_ADMIN_PASSWD (required on first run, no default):

    the admin password of Trac. Only consumed when .htpasswd does not yet exist in $TRAC_DIR; ignored on subsequent starts. Pass via -e on first docker run and omit thereafter.

  • TRAC_PROJECT_NAME (default is trac_project):

    the Trac project name

  • TRAC_DIR (default is /var/local/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 made some customizations based on your needs.

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

    A database system is needed. The database can be either 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.

docker compose

A minimal docker-compose.yml is included. Copy .env.example to .env, set TRAC_ADMIN_PASSWD, then bring the stack up:

$ cp .env.example .env
$ $EDITOR .env
$ docker compose up -d

Data persists under ./data/ on the host (bind mount).

TLS

The container serves plain HTTP on 8123 with HTTP Basic Auth. Basic Auth credentials over plain HTTP are exposed on the wire — put a TLS-terminating reverse proxy (nginx, Caddy, Traefik, cloud load balancer) in front before exposing this to an untrusted network.

Custom Apache config

You can still customize Apache directly by mapping your own template over /etc/apache2/trac.conf.template — the entrypoint renders it with the current TRAC_DIR and AUTH_NAME:

$ docker run -d -p 8123:8123 \
    -e TRAC_ADMIN_PASSWD=change-me \
    -v ./trac.conf:/etc/apache2/trac.conf.template:ro \
    --name my_trac stephenhsu/trac

Reference

About

Trac(http://trac.edgewall.org/) Dockerfile

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors