Trac Alpine
Create the run.sh file for use to create the project and user admin with password
[krit docker trac-alpine]$ cat run.sh
#!/usr/bin/env bash
# Create Trac project
if [ -f /trac/VERSION ]; then
echo "Project already exists here"
else
echo "Creating a new project"
trac-admin /trac initenv $projectname sqlite:db/trac.db
trac-admin /trac permission add $user $password
trac-admin /trac permission add $user TRAC_ADMIN
htpasswd -cb .htpass $user $password
fi
#tracd --port 8000 /trac
tracd --port 8000 --basic-auth="*,/trac/.htpass,realmname" /trac/
[krit docker trac-alpine]$
Create Dockerfile with content in following
FROM alpine:3.11 RUN apk add --no-cache --upgrade bash ENV projectname="FoodFact" ENV user="admin" ENV password="admin" RUN apk update && apk upgrade RUN apk add trac RUN apk add apache2 RUN apk add apache2-utils RUN mkdir /trac COPY run.sh / RUN chmod +x /run.sh EXPOSE 8000 ENTRYPOINT "/run.sh" && /bin/ash
Then, we build the docker image with tag trac:alpine311
[krit docker trac-alpine]$ cat howtorun.txt docker build -t trac:alpine311 . #docker run -it -v ./myprojects:/trac --name trac -p 8000:8000 trac:alpine311 /bin/ash docker run -it -d --restart unless-stopped -v ./myprojects:/trac --name trac -p 8000:8000 trac:alpine311 /bin/ash [krit docker trac-alpine]$
After docker container start, we exec -it in container to check permission
/trac # trac-admin . permission list User Action ------------------------------ admin TRAC_ADMIN anonymous BROWSER_VIEW ... /trac #
Last modified 6 months ago
Last modified on 04/26/25 00:35:30
Attachments (2)
- Dockerfile (327 bytes) - added by 6 months ago.
- run.sh (386 bytes) - added by 6 months ago.
Download all attachments as: .zip
![(please configure the [header_logo] section in trac.ini)](/Utils/chrome/site/your_project_logo.png)