wiki:Tracalpine

Version 3 (modified by krit, 2 months ago) (diff)

--

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]$ 

Attachments (2)

Download all attachments as: .zip