1
1
# Louis BAYLE, 2018-10-11
2
- # Version 0.5
3
2
4
- # 2018-10-11: update apache 2.4.25 fur security updates
5
3
# 2020-05-24: update to PHP v7.4
6
- # 2021-11-11: do not include phpmyadmin
7
4
# 2021-11-11: update to PHP v8.1
8
5
9
- FROM centos:centos7
10
- MAINTAINER Louis BAYLE <
[email protected] >
11
-
12
6
# ====================================================
13
7
# Container with Apache, PHP8.1, Mantis, CodevTT
14
- # ====================================================
8
+ #
9
+ # https://github.com/lbayle/codev
15
10
# https://hub.docker.com/r/lbayle/codevtt/
16
11
17
12
# ====================================================
18
- # build
19
- # ====================================================
20
- # docker build --rm -t codevtt:1.8.0 .
13
+ # Build instructions:
14
+ # docker build --rm -t codevtt:1.8.0 .
21
15
22
16
# ====================================================
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
+
24
26
# ====================================================
25
27
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
[email protected] >
28
30
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"]
35
33
36
34
# Set proxy
37
35
# ENV http_proxy=http://111.222.333.444:8080
@@ -104,6 +102,34 @@ RUN yum -y --enablerepo=remi-php81 install \
104
102
105
103
# ------------------
106
104
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
+
107
133
# set system timezone
108
134
ENV TZ=Europe/Paris
109
135
RUN 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 && \
125
151
# ------------------
126
152
# install MantisBT
127
153
128
- ENV MANTIS_VER 2.25.8
154
+ ENV MANTIS_VER 2.26.0
129
155
ENV MANTIS_URL https://downloads.sourceforge.net/project/mantisbt/mantis-stable/${MANTIS_VER}/mantisbt-${MANTIS_VER}.tar.gz
130
156
ENV MANTIS_FILE mantisbt-${MANTIS_VER}.tar.gz
131
157
@@ -141,7 +167,7 @@ RUN set -xe \
141
167
# ------------------
142
168
# install CodevTT
143
169
144
- ENV CODEVTT_VER 1.8.0
170
+ ENV CODEVTT_VER 1.8.1
145
171
ENV CODEVTT_FILE codevtt_v${CODEVTT_VER}.zip
146
172
ENV CODEVTT_URL https://github.com/lbayle/codev/releases/download/${CODEVTT_VER}/${CODEVTT_FILE}
147
173
@@ -159,34 +185,14 @@ RUN set -xe \
159
185
&& cd /var/www/html/mantis/plugins \
160
186
&& ln -s /var/www/html/codevtt/mantis_plugin/mantis_2_0/CodevTT \
161
187
&& ln -s /var/www/html/codevtt/mantis_plugin/mantis_2_0/FilterBugList \
188
+ && mkdir -p /var/www/html/codevtt \
162
189
&& 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
186
192
187
193
# ------------------
188
- # Adding config files (bugtracker)
189
- # ADD httpd_config/ssl.conf /etc/httpd/conf.d/ssl.conf
194
+ # Adding default config files
195
+
190
196
ADD mantis_config/config_inc.php /var/www/html/mantis/config/
191
197
ADD mantis_config/custom_constants_inc.php /var/www/html/mantis/config/
192
198
ADD 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/
195
201
ADD codevtt_config/log4php.xml /var/www/html/codevtt/
196
202
ADD index.html /var/www/html/index.html
197
203
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
-
206
204
# the entrypoint.sh will create the initial configuration files if not found
207
205
# this may happen if you decide to override some directories with docker volumes
208
206
ADD entrypoint.sh /entrypoint.sh
209
207
ADD mantis_config /install/mantis_config
210
208
ADD codevtt_config /install/codevtt_config
211
209
ADD 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
212
215
213
216
# ------------------
214
217
218
+ # the entrypoint will check configuration & launch httpd
215
219
EXPOSE 80
216
220
ENTRYPOINT ["/entrypoint.sh" ]
217
221
CMD ["-D" , "FOREGROUND" ]
0 commit comments