Public Repository

Last pushed: 4 months ago
Short Description
A Docker Subversion Apache2 Container.
Full Description

What is Subversion

A Docker Subversion Apache2 Container.

It gives you automatically daily dumps of your SVN Repos for your Backup.
Also you are able to create a new Project by just adding a new Folder to your repository root directory.

You can control the access of your Project with a htpasswd file in combination with a authz file.

Dockerfile

FROM ubuntu:14.04
MAINTAINER jongha0212

ENV LANG C.UTF-8
ENV TZ=Asia/Seoul

RUN apt-get update; apt-get install -y \
    apache2 \
    openssl \
    tzdata \
    vim \
    php5 \
    subversion \
    libapache2-svn \
    apache2-mpm-prefork \
    subversion-tools \
    apache2-utils \
    libapache2-modsecurity \
    libapache2-mod-perl2 \
    libapache-dbi-perl \
    libauthen-simple-ldap-perl \
    && rm -rf /var/lib/apt/lists/*

RUN rm -rf /var/www/html/*; rm -rf /etc/apache2/sites-enabled/*; \
    mkdir -p /etc/apache2/external

ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_USER www-data
ENV APACHE_LOG_DIR /var/log/apache2

RUN sed -i 's/^ServerSignature/#ServerSignature/g' /etc/apache2/conf-enabled/security.conf; \
    sed -i 's/^ServerTokens/#ServerTokens/g' /etc/apache2/conf-enabled/security.conf; \
    echo "ServerSignature Off" >> /etc/apache2/conf-enabled/security.conf; \
    echo "ServerTokens Prod" >> /etc/apache2/conf-enabled/security.conf; \
    a2enmod ssl; \
    a2enmod headers; \
    echo "SSLProtocol ALL -SSLv2 -SSLv3" >> /etc/apache2/apache2.conf

ADD 000-default.conf /etc/apache2/sites-enabled/000-default.conf
ADD 001-default-ssl.conf /etc/apache2/sites-enabled/001-default-ssl.conf

RUN a2enmod dav_svn
RUN a2enmod auth_digest
RUN a2enmod ldap
RUN a2enmod authnz_ldap

RUN mkdir /var/svn-backup
RUN mkdir -p /var/local/svn
RUN mkdir /etc/apache2/dav_svn

ADD files/dav_svn.conf /etc/apache2/mods-available/dav_svn.conf

ADD files/svn-backuper.sh /usr/local/bin/
ADD files/svn-project-creator.sh /usr/local/bin/
ADD files/svn-entrypoint.sh /usr/local/bin/

RUN chmod a+x /usr/local/bin/svn*

EXPOSE 80
EXPOSE 443

ADD entrypoint.sh /opt/entrypoint.sh
RUN chmod a+x /opt/entrypoint.sh

RUN echo "*/10 * * * *  root    /usr/local/bin/svn-project-creator.sh" >> /etc/crontab
RUN echo "0 0 * * * root    /usr/local/bin/svn-backuper.sh" >> /etc/crontab

RUN sed -i 's/# exec CMD/&\nsvn-entrypoint.sh/g' /opt/entrypoint.sh

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

COPY httpd-foreground /usr/local/bin/

ENTRYPOINT ["/opt/entrypoint.sh"]

VOLUME ["/var/local/svn", "/var/svn-backup", "/etc/apache/dav_svn"]

CMD ["/usr/local/bin/httpd-foreground"]

Build

docker build -t jongha0212/subversion .

How to use tihs Image

docker run \
    --detach \
    --volume $SVN_PATH/svn:/var/local/svn \
    --volume $SVN_PATH/svn-backup:/var/svn-backup \
    --volume $SVN_PATH/dav_svn:/etc/apache2/dav_svn/ \
    --volume $SVN_PATH/subversion/files/dav_svn.conf:/etc/apache2/mods-available/dav_svn.conf \
    --publish 3690:80 \
    --hostname dev-svn \
    --name subversion \
jongha0212/subversion
Docker Pull Command
Owner
jongha0212

Comments (0)