cleaned up docker related files

This commit is contained in:
hyung-hwan 2022-08-17 01:02:04 +00:00
parent 3d290e2bb6
commit 84ffbf88b6
7 changed files with 49 additions and 49 deletions

View File

@ -30,6 +30,7 @@ RUN sed -ri -e 's|^database_hostname[[:space:]]*=[[:space:]]*"localhost"$|databa
-e 's|^database_driver[[:space:]]*=[[:space:]]*""$|database_driver = "sqlite"|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 -e 's|^database_use_pdo[[:space:]]*=[[:space:]]*"no"$|database_use_pdo = "yes"|g' ${VROOT}/etc/codepot/codepot.ini
COPY httpd-fg.sh ${VROOT}/usr/sbin/
RUN tar -C ${VROOT} -zcvf /tmp/codepot-root.tar.gz . RUN tar -C ${VROOT} -zcvf /tmp/codepot-root.tar.gz .
### ------------------------------------------------------------------------------- ### -------------------------------------------------------------------------------
@ -38,27 +39,26 @@ FROM rockylinux/rockylinux:latest
ARG VROOT ARG VROOT
## epel-release for mod_perl COPY --from=installer /tmp/codepot-root.tar.gz /tmp
RUN dnf install -y epel-release ##COPY httpd-fg.sh /usr/sbin/
# for mysql access, include php-mysqli and perl-DBD-MYSQL ## epel-release for mod_perl
RUN dnf install -y --enablerepo=powertools \ ## for mysql access, include php-mysqli and perl-DBD-MYSQL
RUN \
dnf install -y epel-release && \
dnf install -y --enablerepo=powertools \
subversion subversion-perl \ subversion subversion-perl \
httpd php php-gd php-pdo php-ldap \ httpd php php-gd php-pdo php-ldap \
perl-Digest-SHA perl-Config-Simple \ perl-Digest-SHA perl-Config-Simple \
perl-DBD-SQLite perl-LDAP perl-Mail-Sendmail perl-Switch \ perl-DBD-SQLite perl-LDAP perl-Mail-Sendmail perl-Switch \
mod_dav_svn mod_perl diffutils sqlite mod_dav_svn mod_perl diffutils sqlite && \
COPY --from=installer /tmp/codepot-root.tar.gz /tmp
COPY httpd-fg.sh /usr/sbin/
RUN \
rm -rf /var/www/html && \ rm -rf /var/www/html && \
mkdir -p /run/php-fpm && \ mkdir -p /run/php-fpm && \
tar -C / -zxvf /tmp/codepot-root.tar.gz && \ tar -C / -zxvf /tmp/codepot-root.tar.gz && \
cp -pf /etc/codepot/codepot.httpd /etc/httpd/conf.d/codepot.conf && \ cp -pf /etc/codepot/codepot.httpd /etc/httpd/conf.d/codepot.conf && \
echo "PerlSwitches -Mlib=/etc/codepot/perl" >> /etc/httpd/conf.d/perl.conf && \ echo "PerlSwitches -Mlib=/etc/codepot/perl" >> /etc/httpd/conf.d/perl.conf && \
sed -ri -e 's|^max_execution_time[[:space:]]*=.*$|max_execution_time = 120|g' /etc/php.ini sed -ri -e 's|^max_execution_time[[:space:]]*=.*$|max_execution_time = 120|g' /etc/php.ini && \
rm -rf /tmp/*
##CMD ["/usr/sbin/httpd-fg.sh"] ##CMD ["/usr/sbin/httpd-fg.sh"]
ENTRYPOINT ["/usr/sbin/httpd-fg.sh"] ENTRYPOINT ["/usr/sbin/httpd-fg.sh"]

View File

@ -33,6 +33,7 @@ RUN sed -ri -e 's|^database_hostname[[:space:]]*=[[:space:]]*"localhost"$|databa
-e 's|^database_driver[[:space:]]*=[[:space:]]*""$|database_driver = "sqlite"|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 -e 's|^database_use_pdo[[:space:]]*=[[:space:]]*"no"$|database_use_pdo = "yes"|g' ${VROOT}/etc/codepot/codepot.ini
COPY apache2-fg.sh ${VROOT}/usr/sbin/
RUN tar -C ${VROOT} -zcvf /tmp/codepot-root.tar.gz . RUN tar -C ${VROOT} -zcvf /tmp/codepot-root.tar.gz .
@ -42,19 +43,16 @@ FROM ubuntu:20.04
ARG VROOT ARG VROOT
RUN apt update && \ COPY --from=installer /tmp/codepot-root.tar.gz /tmp
RUN \
apt update && \
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \ DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
subversion apache2 \ subversion apache2 \
php libapache2-mod-php php-gd php-sqlite3 php-ldap \ php libapache2-mod-php php-gd php-sqlite3 php-ldap \
libapache2-mod-perl2 libapache2-mod-svn \ libapache2-mod-perl2 libapache2-mod-svn \
libswitch-perl libconfig-simple-perl libdigest-sha-perl \ libswitch-perl libconfig-simple-perl libdigest-sha-perl \
libdbd-sqlite3-perl libnet-ldap-perl libsvn-perl libmail-sendmail-perl \ libdbd-sqlite3-perl libnet-ldap-perl libsvn-perl libmail-sendmail-perl sqlite3 vim-tiny && \
sqlite3 vim
COPY --from=installer /tmp/codepot-root.tar.gz /tmp
COPY apache2-fg.sh /usr/sbin/
RUN \
rm -rf /var/www/html && \ rm -rf /var/www/html && \
tar -C / -zxvf /tmp/codepot-root.tar.gz && \ tar -C / -zxvf /tmp/codepot-root.tar.gz && \
a2enmod rewrite && a2enmod headers && \ a2enmod rewrite && a2enmod headers && \

View File

@ -1,11 +1,11 @@
DOCKER ?= docker DOCKER ?= DOCKER_BUILDKIT=1 docker
all: all:
@echo "Choose one of the following targets:" @echo "Choose one of the following targets:"
@echo " rocky ubnt2004" @echo " rocky ubnt"
ubnt2004: @srcdir@/codepot-@VERSION@.tar.gz ubnt: @srcdir@/codepot-@VERSION@.tar.gz
$(DOCKER) build -t codepot:ubnt20.04 -f @srcdir@/Dockerfile.ubnt2004 @srcdir@ || true $(DOCKER) build -t codepot:ubnt -f @srcdir@/Dockerfile.ubnt @srcdir@ || true
rm -f @srcdir@/codepot-@VERSION@.tar.gz rm -f @srcdir@/codepot-@VERSION@.tar.gz
rocky: @srcdir@/codepot-@VERSION@.tar.gz rocky: @srcdir@/codepot-@VERSION@.tar.gz

View File

@ -410,14 +410,14 @@ uninstall-am:
.PRECIOUS: Makefile .PRECIOUS: Makefile
DOCKER ?= docker DOCKER ?= DOCKER_BUILDKIT=1 docker
all: all:
@echo "Choose one of the following targets:" @echo "Choose one of the following targets:"
@echo " rocky ubnt2004" @echo " rocky ubnt"
ubnt2004: @srcdir@/codepot-@VERSION@.tar.gz ubnt: @srcdir@/codepot-@VERSION@.tar.gz
$(DOCKER) build -t codepot:ubnt20.04 -f @srcdir@/Dockerfile.ubnt2004 @srcdir@ || true $(DOCKER) build -t codepot:ubnt -f @srcdir@/Dockerfile.ubnt @srcdir@ || true
rm -f @srcdir@/codepot-@VERSION@.tar.gz rm -f @srcdir@/codepot-@VERSION@.tar.gz
rocky: @srcdir@/codepot-@VERSION@.tar.gz rocky: @srcdir@/codepot-@VERSION@.tar.gz

View File

@ -1,15 +1,15 @@
If you require the root privilege to build a docker image, specify sudo in DOCKER. If you require the root privilege to build a docker image, specify sudo in DOCKER.
``` ```
make rocky8 DOCKER="sudo docker" make rocky DOCKER="sudo docker"
make ubnt2004 DOCKER="sudo docker" make ubnt DOCKER="sudo docker"
``` ```
Run the service like Run the service like
``` ```
docker run -dit --restart=unless-stopped --name=codepot codepot:ubnt20.04 docker run -dit --restart=unless-stopped --name=codepot codepot:ubnt
docker run -dit --restart=unless-stopped --name=codepot -p 80:80 codepot:ubnt20.04 docker run -dit --restart=unless-stopped --name=codepot -p 80:80 codepot:ubnt
docker run -dit --restart=unless-stopped --name=codepot -p 80:80 -v /home/container-data/codepot:/var/lib/codepot codepot:ubnt20.04 docker run -dit --restart=unless-stopped --name=codepot -p 80:80 -v /home/container-data/codepot:/var/lib/codepot codepot:ubnt
docker run -dit --restart=unless-stopped --name=codepot -p 1200:1200 -v /home/container-data/codepot:/var/lib/codepot codepot:ubnt20.04 --port 1200 --hide-index-page=yes --https-redirected=yes docker run -dit --restart=unless-stopped --name=codepot -p 1200:1200 -v /home/container-data/codepot:/var/lib/codepot codepot:ubnt --port 1200 --hide-index-page=yes --https-redirected=yes
``` ```
Run the shell on the existing container for in-container management. Run the shell on the existing container for in-container management.

View File

@ -62,6 +62,7 @@ do
echo " -hide-index-page yes/no hide/show the index page script from the URL" echo " -hide-index-page yes/no hide/show the index page script from the URL"
echo " -https-redirected yes/no indicate if the requets are HTTPS redirected" echo " -https-redirected yes/no indicate if the requets are HTTPS redirected"
echo "-------------------------------------------------------------------------" echo "-------------------------------------------------------------------------"
exit 0
;; ;;
p) p)
SERVICE_PORT=${OPTARG#*=} SERVICE_PORT=${OPTARG#*=}

View File

@ -62,6 +62,7 @@ do
echo " -hide-index-page yes/no hide/show the index page script from the URL" echo " -hide-index-page yes/no hide/show the index page script from the URL"
echo " -https-redirected yes/no indicate if the requets are HTTPS redirected" echo " -https-redirected yes/no indicate if the requets are HTTPS redirected"
echo "-------------------------------------------------------------------------" echo "-------------------------------------------------------------------------"
exit 0
;; ;;
p) p)
SERVICE_PORT=${OPTARG#*=} SERVICE_PORT=${OPTARG#*=}