From 19b380cee0816711f6e741c28ce9a065a995b61d Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 7 Sep 2021 07:01:20 +0000 Subject: [PATCH] updating docker build procedures --- codepot/docker/Dockerfile.ubnt2004 | 9 ++++++++ codepot/docker/build-ubnt2004.sh | 35 +++++++++++++----------------- codepot/etc/codepot.ini.in | 2 +- 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/codepot/docker/Dockerfile.ubnt2004 b/codepot/docker/Dockerfile.ubnt2004 index 07328892..104c15f0 100644 --- a/codepot/docker/Dockerfile.ubnt2004 +++ b/codepot/docker/Dockerfile.ubnt2004 @@ -1,5 +1,14 @@ FROM ubuntu:20.04 +RUN apt update && \ + DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \ + subversion mariadb-server mariadb-client apache2 \ + php libapache2-mod-php php-gd php-sqlite3 \ + libapache2-mod-perl2 libapache2-mod-svn \ + libswitch-perl libconfig-simple-perl libdigest-sha-perl \ + libdbd-sqlite3-perl libnet-ldap-perl libsvn-perl libmail-sendmail-perl \ + sqlite3 php-dev libsvn-dev make vim + COPY build-ubnt2004.sh /tmp RUN /tmp/build-ubnt2004.sh && rm -rf /tmp/* diff --git a/codepot/docker/build-ubnt2004.sh b/codepot/docker/build-ubnt2004.sh index ecee4493..cdec5545 100755 --- a/codepot/docker/build-ubnt2004.sh +++ b/codepot/docker/build-ubnt2004.sh @@ -1,13 +1,14 @@ cd /tmp -apt-get update && -DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - subversion mariadb-server mariadb-client apache2 \ - php libapache2-mod-php php-mysql php-gd \ - libapache2-mod-perl2 libapache2-mod-svn \ - libswitch-perl libconfig-simple-perl libdigest-sha-perl \ - libdbd-mysql-perl libdbd-sqlite3-perl libnet-ldap-perl libsvn-perl libmail-sendmail-perl \ - php-dev libsvn-dev make +#apt update && +#DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \ +# subversion mariadb-server mariadb-client apache2 \ +# php libapache2-mod-php php-gd php-sqlite3 \ +# libapache2-mod-perl2 libapache2-mod-svn \ +# libswitch-perl libconfig-simple-perl libdigest-sha-perl \ +# libdbd-sqlite3-perl libnet-ldap-perl libsvn-perl libmail-sendmail-perl \ +# sqlite3 php-dev libsvn-dev make vim + svn co http://code.miflux.com/svn/codepot/trunk/codepot && \ cd codepot && \ @@ -25,17 +26,11 @@ cd codepot && \ 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 && \ -service mysql start && sleep 5 && \ -mysql -e 'create database codepot' && \ -mysql -e 'source /etc/codepot/codepot.mysql' codepot && \ -mysql -e 'create user "codepot"@"localhost" identified by "codepot"' && \ -mysql -e 'grant all privileges on codepot.* to "codepot"@"localhost"' && \ -sed -ri -e 's|^database_hostname[[:space:]]*=[[:space:]]*""$|database_hostname = "localhost"|g' \ - -e 's|^database_username[[:space:]]*=[[:space:]]*""$|database_username = "codepot"|g' \ - -e 's|^database_password[[:space:]]*=[[:space:]]*""$|database_password = "codepot"|g' \ - -e 's|^database_name[[:space:]]*=[[:space:]]*""$|database_name = "codepot"|g' \ - -e 's|^database_driver[[:space:]]*=[[:space:]]*""$|database_driver = "mysqli"|g' /etc/codepot/codepot.ini && \ +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 && \ @@ -57,7 +52,7 @@ cat < /var/www/html/index.html EOF -apt-get remove --purge -y --allow-remove-essential php-dev libsvn-dev make libfdisk1 && \ -apt-get autoremove --purge -y && rm -rf /var/lib/apt/lists/* +apt remove --purge -y --allow-remove-essential php-dev libsvn-dev make libfdisk1 && \ +apt autoremove --purge -y && rm -rf /var/lib/apt/lists/* rm -rf /root/.subversion diff --git a/codepot/etc/codepot.ini.in b/codepot/etc/codepot.ini.in index 3d3c72c7..8faba9a7 100644 --- a/codepot/etc/codepot.ini.in +++ b/codepot/etc/codepot.ini.in @@ -69,8 +69,8 @@ database_username = "" database_password = "" database_name = "" database_driver = "" -database_prefix = "" database_use_pdo = "no" +database_prefix = "" database_store_gmt = "yes" ;------------------------------------------------------------------------------