From 0f3a718b8f2bcc8c903a5c20540f1b863da654e8 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 7 Sep 2021 07:23:24 +0000 Subject: [PATCH] updating docker build procedures --- codepot/docker/apache2-fg.sh | 15 +++++++++++++-- codepot/docker/build-ubnt2004.sh | 7 +------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/codepot/docker/apache2-fg.sh b/codepot/docker/apache2-fg.sh index e91bea49..6c49e407 100755 --- a/codepot/docker/apache2-fg.sh +++ b/codepot/docker/apache2-fg.sh @@ -37,5 +37,16 @@ for e in "${!APACHE_@}"; do fi done -# start the mysql service and run the httpd server in the foreground -service mysql start && sleep 2 && exec apache2 -DFOREGROUND "$@" +[ ! -d /var/lib/codepot/attachments ] && mkdir -p /var/lib/codepot/attachments +[ ! -d /var/lib/codepot/files ] && mkdir -p /var/lib/codepot/files +[ ! -d /var/lib/codepot/issuefiles ] && mkdir -p /var/lib/codepot/issuefiles +[ ! -d /var/lib/codepot/svnrepo ] && mkdir -p /var/lib/codepot/svnrepo +[ ! -d /var/lib/codepot/usericons ] && mkdir -p /var/lib/codepot/usericons +[ ! -f /var/lib/codepot/codepot.db ] && sqlite3 -init /etc/codepot/codepot.sqlite /var/lib/codepot/codepot.db "" + +mkdir -p /var/cache/codepot /var/log/codepot +chown -R www-data:www-data /var/lib/codepot /var/cache/codepot /var/log/codepot + + +#httpd server in the foreground +exec apache2 -DFOREGROUND "$@" diff --git a/codepot/docker/build-ubnt2004.sh b/codepot/docker/build-ubnt2004.sh index cdec5545..41680d11 100755 --- a/codepot/docker/build-ubnt2004.sh +++ b/codepot/docker/build-ubnt2004.sh @@ -24,18 +24,13 @@ cd codepot && \ --with-phpextdir=`php-config --extension-dir` \ --with-phpextinidir=`php-config --ini-dir | sed 's|/cli/|/apache2/|g'` && \ make && make install && \ -mkdir -p /var/lib/codepot/svnrepo /var/lib/codepot/files && \ -mkdir -p /var/cache/codepot /var/log/codepot && \ -sqlite3 -init /etc/codepot/codepot.sqlite /var/lib/codepot/codepot.db "" && \ -chown -R www-data:www-data /var/lib/codepot /var/cache/codepot /var/log/codepot && \ 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' /etc/codepot/codepot.ini && \ sed -ri -e 's|Digest::SHA1|Digest::SHA|g' /usr/sbin/codepot-user && \ sed -ri -e 's|Digest::SHA1|Digest::SHA|g' /etc/codepot/perl/Codepot/AccessHandler.pm && \ install -m 0755 -D -t /usr/sbin docker/apache2-fg.sh && \ -cd .. && \ -cd .. && \ +cd ../.. && \ \ cp -pf /etc/codepot/codepot.httpd /etc/apache2/conf-enabled/codepot.conf && \ echo "PerlSwitches -Mlib=/etc/codepot/perl" >> /etc/apache2/conf-enabled/perl.conf