ARG VROOT=/tmp/codepot-root ### ------------------------------------------------------------------------------- FROM alpine:3.15 as installer ARG VROOT RUN apk add --no-cache \ php7-dev subversion-dev make gcc musl-dev \ apache2 apache2-dev perl-dev alpine-sdk COPY codepot-0.4.0.tar.gz /tmp COPY apache2-mod-perl/APKBUILD /tmp COPY apache2-mod-perl/apache2-mod-perl.conf /tmp RUN \ cd /tmp && \ abuild-keygen -n -a && \ cp -pfr /root/.abuild/*.rsa.pub /etc/apk/keys/ && \ abuild -F -d && \ tar -zxvf codepot-0.4.0.tar.gz && \ cd codepot-0.4.0 && \ ./configure \ --prefix=/usr \ --libdir=/usr/lib64 \ --sysconfdir=/etc \ --with-wwwdir=/var/www/html \ --with-cfgdir=/etc/codepot \ --with-depotdir=/var/lib/codepot \ --with-logdir=/var/log/codepot \ --with-cachedir=/var/cache/codepot \ --with-phpextdir=`php-config --extension-dir` \ --with-phpextinidir=/etc/php7/conf.d \ make && make install DESTDIR=${VROOT} && rm -rf ${VROOT}/var/lib/codepot/* RUN sed -ri -e 's|^database_hostname[[:space:]]*=[[:space:]]*"localhost"$|database_hostname = "/var/lib/codepot/codepot.db"|g' \ -e 's|^database_driver[[:space:]]*=[[:space:]]*""$|database_driver = "sqlite"|g' \ -e 's|^database_use_pdo[[:space:]]*=[[:space:]]*"no"$|database_use_pdo = "yes"|g' ${VROOT}/etc/codepot/codepot.ini RUN mkdir -p ${VROOT}/etc/apache2/conf.d && echo LoadModule dav_svn_module modules/mod_dav_svn.so > ${VROOT}/etc/apache2/conf.d/mod_dav_svn.conf COPY alpine-httpd-fg.sh ${VROOT}/usr/sbin/ RUN tar -C ${VROOT} -zcvf /tmp/codepot-root.tar.gz . ### ------------------------------------------------------------------------------- FROM alpine:3.15 ARG VROOT COPY --from=installer /tmp/codepot-root.tar.gz /tmp COPY --from=installer /root/packages/x86_64/apache2-mod-perl-2.0.12-r1.apk /tmp RUN \ apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \ subversion apache2 libldap \ php7-apache2 php7-gd php7-sqlite3 php7-ldap php7-mbstring php7-ctype \ php7-iconv php7-pdo php7-pdo_sqlite php7-pdo_mysql php7-zip \ apache2-webdav mod_dav_svn \ perl-switch perl-config-simple perl-digest-sha1 \ perl-dbd-sqlite perl-ldap perl-subversion perl-mail-sendmail sqlite bash && \ apk add --allow-untrusted /tmp/apache2-mod-perl-2.0.12-r1.apk && \ rm -rf /var/www/html && \ tar -C / -zxvf /tmp/codepot-root.tar.gz && \ cp -pf /etc/codepot/codepot.httpd /etc/apache2/conf.d/codepot.conf && \ echo "PerlSwitches -Mlib=/etc/codepot/perl" >> /etc/apache2/conf.d/perl.conf && \ sed -ri -e 's|^max_execution_time[[:space:]]*=.*$|max_execution_time = 120|g' /etc/php7/php.ini && \ sed -ri -e 's|/var/www/localhost/htdocs|/var/www/html|g' \ -e 's|^User apache$|User nobody|g' \ -e 's|^Gruop apache$|Group nobody|g' \ -e 's|^#(LoadModule rewrite_module modules/mod_rewrite.so)|\1|g' \ -e 's|AllowOverride None|AllowOverride All|g' /etc/apache2/httpd.conf && \ rm -rf /tmp/* ENTRYPOINT ["/usr/sbin/alpine-httpd-fg.sh"]