Skip to content

Commit 34cec4d

Browse files
committed
Apache starts and serves pages
1 parent f984e90 commit 34cec4d

File tree

3 files changed

+31
-11
lines changed

3 files changed

+31
-11
lines changed

Dockerfile

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ LABEL name="httpd-svn" \
33
description="Apache httpd with Subversion" \
44
maintainer="erik.wramner@codemint.com"
55

6-
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
7-
#RUN groupadd -r www-data && useradd -r --create-home -g www-data www-data
8-
96
ENV HTTPD_VERSION 2.4.34
107
ENV HTTPD_SHA256 fa53c95631febb08a9de41fd2864cfff815cf62d9306723ab0d4b8d7aa1638f0
118
ENV SVN_VERSION 1.10.2
@@ -16,7 +13,6 @@ ENV OPENSSL_VERSION 1.0.2l-1~bpo8+1
1613
ENV HTTPD_PREFIX /usr/local/apache2
1714
ENV PATH $HTTPD_PREFIX/bin:$PATH
1815

19-
COPY httpd-foreground /usr/local/bin/
2016
RUN mkdir -p "$HTTPD_PREFIX" \
2117
&& chown www-data:www-data "$HTTPD_PREFIX"
2218
WORKDIR $HTTPD_PREFIX
@@ -70,8 +66,13 @@ RUN set -eux; \
7066
\
7167
# mod_http2 mod_lua mod_proxy_html mod_xml2enc
7268
# https://anonscm.debian.org/cgit/pkg-apache/apache2.git/tree/debian/control?id=adb6f181257af28ee67af15fc49d2699a0080d4c
73-
buildDeps=" \
69+
\
70+
runtimeDeps=" \
7471
bzip2 \
72+
libsqlite3-0 \
73+
zlib1g \
74+
"; \
75+
buildDeps=" \
7576
ca-certificates \
7677
dpkg-dev \
7778
gcc \
@@ -86,7 +87,7 @@ RUN set -eux; \
8687
wget \
8788
"; \
8889
apt-get update; \
89-
apt-get install -y --no-install-recommends -V $buildDeps; \
90+
apt-get install -y --no-install-recommends -V $buildDeps $runtimeDeps; \
9091
rm -r /var/lib/apt/lists/*; \
9192
\
9293
ddist() { \
@@ -170,14 +171,18 @@ RUN set -eux; \
170171
sed -ri \
171172
-e 's!^(\s*CustomLog)\s+\S+!\1 /proc/self/fd/1!g' \
172173
-e 's!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g' \
174+
-e 's!^#LoadModule dav_module modules/mod_dav.so!LoadModule dav_module modules/mod_dav.so!g' \
173175
"$HTTPD_PREFIX/conf/httpd.conf"; \
174176
\
175177
apt-get purge -y --auto-remove $buildDeps
176178

177179
RUN mkdir -p /svn/repos \
178180
&& mkdir -p /svn/config \
181+
&& mkdir -p /svn/backup \
179182
&& chown www-data:www-data /svn
180183
VOLUME ["/svn"]
181184

185+
COPY httpd-foreground /usr/local/bin/
186+
182187
EXPOSE 80
183188
CMD ["httpd-foreground"]

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
# Apache httpd with Subversion
2-
3-
This image provides Apache configured for use as a Subversion server. The docker file has been copied from [docker-library/httpd](https://github.com/docker-library/httpd)
4-
and modified to build Subversion as well as Apache. It was a bit messy to use the official image as a base and compile Subversion afterwards as the two builds share
5-
many build dependencies; otherwise that would have been nicer.
1+
# Apache httpd with Subversion
2+
3+
This image provides Apache configured for use as a Subversion server. The docker file has been copied from [docker-library/httpd](https://github.com/docker-library/httpd)
4+
and modified to build Subversion as well as Apache.
5+
6+
## Usage
7+
8+
9+
## Notes
10+
11+
* It is important to set the ServerName option to the real external host name, as Subversion (or rather DAV) needs it for the copy command.
12+
Set HTTPD_SERVER_NAME when using the default configuration or be sure to set it manually. If not defined the container's host name will
13+
be used and that is probably wrong.
14+
* It is a very good idea to require SSL/TLS or alternatively to use a web front with SSL. The default configuration assumes a web front.

httpd-foreground

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,10 @@ set -e
44
# Apache gets grumpy about PID files pre-existing
55
rm -f /usr/local/apache2/logs/httpd.pid
66

7+
# Ensure that we have a server name defined
8+
if [ "$HTTPD_SERVER_NAME" = "" ]
9+
then
10+
HTTPD_SERVER_NAME=$HOSTNAME; export HTTPD_SERVER_NAME
11+
fi
12+
713
exec httpd -DFOREGROUND

0 commit comments

Comments
 (0)