11# Louis BAYLE, 2018-10-11
2- # Version 0.5
32
4- # 2018-10-11: update apache 2.4.25 fur security updates
53# 2020-05-24: update to PHP v7.4
6- # 2021-11-11: do not include phpmyadmin
74# 2021-11-11: update to PHP v8.1
85
9- FROM centos:centos7
10- MAINTAINER Louis BAYLE <lbayle.work@gmail.com>
11-
126# ====================================================
137# Container with Apache, PHP8.1, Mantis, CodevTT
14- # ====================================================
8+ #
9+ # https://github.com/lbayle/codev
1510# https://hub.docker.com/r/lbayle/codevtt/
1611
1712# ====================================================
18- # build
19- # ====================================================
20- # docker build --rm -t codevtt:1.8.0 .
13+ # Build instructions:
14+ # docker build --rm -t codevtt:1.8.0 .
2115
2216# ====================================================
23- # run with docker-compose
17+ # Run with docker-compose:
18+ #
19+ # mkdir -p /data/docker
20+ # cd /data/docker
21+ # wget https://raw.githubusercontent.com/lbayle/codev/master/doc/docker/docker-compose.yml
22+ # wget https://raw.githubusercontent.com/lbayle/codev/master/doc/docker/mantis_codevtt_freshInstall.sql
23+ # docker-compose up -d
24+ # docker exec -i mariadb-codevtt mariadb -uroot -pmy_password --force bugtracker < mantis_codevtt_freshInstall.sql
25+
2426# ====================================================
2527
26- # docker-compose.yml is here:
27- # https://github.com/ lbayle/codev/blob/master/doc/docker/docker-compose.yml
28+ FROM centos:centos7
29+ MAINTAINER Louis BAYLE < lbayle.work@gmail.com>
2830
29- # run:
30- # git clone https://github.com/lbayle/codev.git /data/docker/codevtt/src
31- # docker-compose up -d
32- # docker exec -i docker-mariadb-1 mysql -uroot -pmy_password --force bugtracker < mantis_codevtt_freshInstall.sql
33-
34- # ====================================================
31+ # change the shell command for the RUN commands to be '/bin/bash -c' instead of '/bin/sh -c'
32+ # SHELL ["/bin/bash", "-c"]
3533
3634# Set proxy
3735# ENV http_proxy=http://111.222.333.444:8080
@@ -104,6 +102,34 @@ RUN yum -y --enablerepo=remi-php81 install \
104102
105103# ------------------
106104
105+ RUN sed -i '/^#ServerName/a ServerName codevtt:80' /etc/httpd/conf/httpd.conf
106+
107+ # Allow overriding specific directives in .htaccess
108+ # RUN sed -e '/<Directory "\/var\/www\/html">/,/<\/Directory>/s/AllowOverride None/AllowOverride All/' -i /etc/httpd/conf/httpd.conf
109+
110+ # Update httpd.conf in order to restrict access as defined by .htaccess file.
111+ # .htaccess files are not evaluated since a default apache install does not allow to override directives in /var/www
112+ RUN set -xe \
113+ && echo "#Mantis specific access policy" > /etc/httpd/conf.d/mantis.conf \
114+ && echo "#CodevTT specific access policy" > /etc/httpd/conf.d/codevtt.conf \
115+ && for f in $(find /var/www/html/mantis -name .htaccess) ; do \
116+ echo "<Directory $(dirname $f)>" >> /etc/httpd/conf.d/mantis.conf \
117+ && cat $f >> /etc/httpd/conf.d/mantis.conf \
118+ && echo -e "\n </Directory>\n " >> /etc/httpd/conf.d/mantis.conf \
119+ ; done \
120+ && for f in $(find /var/www/html/codevtt -name .htaccess) ; do \
121+ echo "<Directory $(dirname $f)>" >> /etc/httpd/conf.d/codevtt.conf \
122+ && cat $f >> /etc/httpd/conf.d/codevtt.conf \
123+ && echo -e "\n </Directory>\n " >> /etc/httpd/conf.d/codevtt.conf \
124+ ; done
125+
126+
127+ # FIX Invalid command 'CGIPassAuth', perhaps misspelled or defined by a module not included in the server configuration
128+ # => centos:7 is getting too old...
129+ RUN sed -i '/^CGIPassAuth/ s/./#&/' /etc/httpd/conf.d/mantis.conf
130+
131+ # ------------------
132+
107133# set system timezone
108134ENV TZ=Europe/Paris
109135RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
@@ -125,7 +151,7 @@ RUN echo "max_execution_time = 60" > /etc/php.d/00-docker-php-limits.ini && \
125151# ------------------
126152# install MantisBT
127153
128- ENV MANTIS_VER 2.25.8
154+ ENV MANTIS_VER 2.26.0
129155ENV MANTIS_URL https://downloads.sourceforge.net/project/mantisbt/mantis-stable/${MANTIS_VER}/mantisbt-${MANTIS_VER}.tar.gz
130156ENV MANTIS_FILE mantisbt-${MANTIS_VER}.tar.gz
131157
@@ -141,7 +167,7 @@ RUN set -xe \
141167# ------------------
142168# install CodevTT
143169
144- ENV CODEVTT_VER 1.8.0
170+ ENV CODEVTT_VER 1.8.1
145171ENV CODEVTT_FILE codevtt_v${CODEVTT_VER}.zip
146172ENV CODEVTT_URL https://github.com/lbayle/codev/releases/download/${CODEVTT_VER}/${CODEVTT_FILE}
147173
@@ -159,34 +185,14 @@ RUN set -xe \
159185 && cd /var/www/html/mantis/plugins \
160186 && ln -s /var/www/html/codevtt/mantis_plugin/mantis_2_0/CodevTT \
161187 && ln -s /var/www/html/codevtt/mantis_plugin/mantis_2_0/FilterBugList \
188+ && mkdir -p /var/www/html/codevtt \
162189 && mkdir -p /tmp/codevtt/logs \
163- && chown -R apache:apache /tmp/codevtt
164-
165- # Update httpd.conf in order to restrict access as defined by .htaccess file.
166- # .htaccess files are not evaluated since a default apache install does not allow to override directives in /var/www
167- RUN set -xe \
168- && echo "#Mantis specific access policy" > /etc/httpd/conf.d/mantis.conf \
169- && echo "#CodevTT specific access policy" > /etc/httpd/conf.d/codevtt.conf \
170- && for f in $(find /var/www/html/mantis -name .htaccess) ; do \
171- echo "<Directory $(dirname $f)>" >> /etc/httpd/conf.d/mantis.conf \
172- && cat $f >> /etc/httpd/conf.d/mantis.conf \
173- && echo -e "\n </Directory>\n " >> /etc/httpd/conf.d/mantis.conf \
174- ; done \
175- && for f in $(find /var/www/html/codevtt -name .htaccess) ; do \
176- echo "<Directory $(dirname $f)>" >> /etc/httpd/conf.d/codevtt.conf \
177- && cat $f >> /etc/httpd/conf.d/codevtt.conf \
178- && echo -e "\n </Directory>\n " >> /etc/httpd/conf.d/codevtt.conf \
179- ; done
180-
181- # FIX Invalid command 'CGIPassAuth', perhaps misspelled or defined by a module not included in the server configuration
182- # => centos:7 is getting too old...
183- RUN sed -i '/^CGIPassAuth/ s/./#&/' /etc/httpd/conf.d/mantis.conf
184-
185- RUN sed -i '/^#ServerName/a ServerName codevtt:80' /etc/httpd/conf/httpd.conf
190+ && chown -R apache:apache /tmp/codevtt \
191+ && chown -R apache:apache /var/www/html/codevtt
186192
187193# ------------------
188- # Adding config files (bugtracker)
189- # ADD httpd_config/ssl.conf /etc/httpd/conf.d/ssl.conf
194+ # Adding default config files
195+
190196ADD mantis_config/config_inc.php /var/www/html/mantis/config/
191197ADD mantis_config/custom_constants_inc.php /var/www/html/mantis/config/
192198ADD mantis_config/custom_relationships_inc.php /var/www/html/mantis/config/
@@ -195,23 +201,21 @@ ADD codevtt_config/config.ini /var/www/html/codevtt/config/
195201ADD codevtt_config/log4php.xml /var/www/html/codevtt/
196202ADD index.html /var/www/html/index.html
197203
198- # debug
199- # RUN echo -e "<?php\nphpinfo();\n" > /var/www/html/phpinfo.php
200-
201- # Not realy needed, but you might want to retrieve the appropriate DB init for this image.
202- # docker exec -i docker-mariadb-1 mariadb -uroot -pmy_password --force bugtracker < mantis_codevtt_freshInstall.sql
203- ADD mantis_codevtt_freshInstall.sql /install/mantis_codevtt_freshInstall.sql
204- ADD docker-compose.yml /install/docker-compose.yml
205-
206204# the entrypoint.sh will create the initial configuration files if not found
207205# this may happen if you decide to override some directories with docker volumes
208206ADD entrypoint.sh /entrypoint.sh
209207ADD mantis_config /install/mantis_config
210208ADD codevtt_config /install/codevtt_config
211209ADD phpmyadmin_config /install/phpmyadmin_config
210+ ADD docker-compose.yml /install/docker-compose.yml
211+ ADD mantis_codevtt_freshInstall.sql /install/mantis_codevtt_freshInstall.sql
212+
213+ # debug
214+ # RUN echo -e "<?php\nphpinfo();\n" > /var/www/html/phpinfo.php
212215
213216# ------------------
214217
218+ # the entrypoint will check configuration & launch httpd
215219EXPOSE 80
216220ENTRYPOINT ["/entrypoint.sh" ]
217221CMD ["-D" , "FOREGROUND" ]
0 commit comments