FROM ubuntu:22.04 # Using 22.04 LTS Release MAINTAINER RhodeCode Inc. ENV \ RC_USER=rhodecode \ # SVN CONFIG MOD_DAV_SVN_CONF_FILE=/etc/rhodecode/conf/svn/mod_dav_svn.conf \ MOD_DAV_SVN_PORT=8090 \ MOD_DAV_SVN_LOG_LEVEL=info ENV SVN_LOCALE_DEPS apache2 apache2-utils libapache2-mod-svn subversion #apache2-webdav RUN \ echo "** install svn base packages **" && \ set -eux; \ \ savedAptMark="$(apt-mark showmanual)"; \ apt-get update; \ DEBIAN_FRONTEND="noninteractive" \ apt-get install -y --no-install-recommends \ tini \ bash \ binutils \ tzdata \ locales \ openssl \ curl \ sudo \ gosu \ bzip2 \ ca-certificates \ $SVN_LOCALE_DEPS \ ; \ rm -rf /var/lib/apt/lists/*; # configure the system user # explicitly set uid/gid to guarantee that it won't change in the future # the values 999:999 are identical to the current user/group id assigned RUN \ echo "** Create system user $RC_USER **" && \ groupadd --system --gid 999 $RC_USER && \ useradd --system --gid $RC_USER --uid 999 --shell /bin/bash $RC_USER && \ usermod -G $RC_USER $RC_USER # Apache SVN setup RUN \ echo "**** Apache config cleanup ****" && \ rm -f /etc/apache2/conf.d/info.conf \ /etc/apache2/conf.d/mpm.conf \ /etc/apache2/conf.d/userdir.conf && \ rm -f /etc/apache2/sites-enabled/* && \ rm -f /etc/apache2/sites-available/* # custom SVN virtualhost COPY service/svn/virtualhost.conf /etc/apache2/sites-enabled/ RUN \ echo "**** Apache config ****" && \ echo $(strings /usr/lib/apache2/modules/mod_dav_svn.so | grep 'Powered by') > /var/opt/dav.version && \ mkdir -p /run/apache2 && \ mkdir -p /var/opt/www && \ echo "unset HOME" > /etc/apache2/envvars && \ echo "export APACHE_RUN_USER=${RC_USER}" >> /etc/apache2/envvars && \ echo "export APACHE_PID_FILE=/var/run/apache2/apache2.pid" >> /etc/apache2/envvars && \ echo "export APACHE_RUN_DIR=/var/run/apache2" >> /etc/apache2/envvars && \ echo "export APACHE_LOCK_DIR=/var/lock/apache2" >> /etc/apache2/envvars && \ echo "export APACHE_RUN_USER=${RC_USER}" >> /etc/apache2/envvars && \ echo "export APACHE_RUN_GROUP=${RC_USER}" >> /etc/apache2/envvars && \ sed -i "s/Listen 80/Listen ${MOD_DAV_SVN_PORT}/g" /etc/apache2/ports.conf USER root RUN \ echo "**** cleanup ****" && \ apt-get autoclean -y && \ rm -f /tmp/* && \ rm -rf /var/lib/apt/lists/* \ rm -rf /var/cache/apk/* # copy entrypoints COPY entrypoints.d/svn-entrypoint.sh /opt/entrypoints.d/svn-entrypoint.sh RUN chmod +x /opt/entrypoints.d/svn-entrypoint.sh # config volume VOLUME /etc/rhodecode/conf # repo store volume VOLUME /var/opt/rhodecode_repo_store ENTRYPOINT ["/opt/entrypoints.d/svn-entrypoint.sh"] CMD ["apachectl", "-D", "FOREGROUND"]