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
RUN dnf install -y epel-release
# for mysql access, include php-mysqli and perl-DBD-MYSQL
RUN dnf install -y --enablerepo=powertools \
subversion subversion-perl \
httpd php php-gd php-pdo php-ldap \
perl-Digest-SHA perl-Config-Simple \
perl-DBD-SQLite perl-LDAP perl-Mail-Sendmail perl-Switch \
mod_dav_svn mod_perl diffutils sqlite
COPY --from=installer /tmp/codepot-root.tar.gz /tmp COPY --from=installer /tmp/codepot-root.tar.gz /tmp
COPY httpd-fg.sh /usr/sbin/ ##COPY httpd-fg.sh /usr/sbin/
## epel-release for mod_perl
## for mysql access, include php-mysqli and perl-DBD-MYSQL
RUN \ RUN \
dnf install -y epel-release && \
dnf install -y --enablerepo=powertools \
subversion subversion-perl \
httpd php php-gd php-pdo php-ldap \
perl-Digest-SHA perl-Config-Simple \
perl-DBD-SQLite perl-LDAP perl-Mail-Sendmail perl-Switch \
mod_dav_svn mod_perl diffutils sqlite && \
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 && \
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
subversion apache2 \
php libapache2-mod-php php-gd php-sqlite3 php-ldap \
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 vim
COPY --from=installer /tmp/codepot-root.tar.gz /tmp COPY --from=installer /tmp/codepot-root.tar.gz /tmp
COPY apache2-fg.sh /usr/sbin/
RUN \ RUN \
apt update && \
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
subversion apache2 \
php libapache2-mod-php php-gd php-sqlite3 php-ldap \
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 vim-tiny && \
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

@ -19,7 +19,7 @@ do
;; ;;
port=*) port=*)
SERVICE_PORT=${OPTARG#*=} SERVICE_PORT=${OPTARG#*=}
opt=${OPTARG%=$val} opt=${OPTARG%=$val}
;; ;;
hide-index-page) hide-index-page)
@ -30,7 +30,7 @@ do
hide-index-page=*) hide-index-page=*)
HIDE_INDEX_PAGE=${OPTARG#*=} HIDE_INDEX_PAGE=${OPTARG#*=}
opt=${OPTARG%=$val} opt=${OPTARG%=$val}
;; ;;
https-redirected) https-redirected)
@ -41,11 +41,11 @@ do
https-redirected=*) https-redirected=*)
HTTPS_REDIRECTED=${OPTARG#*=} HTTPS_REDIRECTED=${OPTARG#*=}
opt=${OPTARG%=$val} opt=${OPTARG%=$val}
;; ;;
*) *)
echo "Warning: unknown option - $OPTARG" echo "Warning: unknown option - $OPTARG"
;; ;;
esac esac
;; ;;
@ -62,14 +62,15 @@ 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#*=}
opt=${OPTARG%=$val} opt=${OPTARG%=$val}
;; ;;
*) *)
echo "Warning: unknown option - $OPTARG" echo "Warning: unknown option - $OPTARG"
;; ;;
esac esac
done done

View File

@ -19,7 +19,7 @@ do
;; ;;
port=*) port=*)
SERVICE_PORT=${OPTARG#*=} SERVICE_PORT=${OPTARG#*=}
opt=${OPTARG%=$val} opt=${OPTARG%=$val}
;; ;;
hide-index-page) hide-index-page)
@ -30,7 +30,7 @@ do
hide-index-page=*) hide-index-page=*)
HIDE_INDEX_PAGE=${OPTARG#*=} HIDE_INDEX_PAGE=${OPTARG#*=}
opt=${OPTARG%=$val} opt=${OPTARG%=$val}
;; ;;
https-redirected) https-redirected)
@ -41,11 +41,11 @@ do
https-redirected=*) https-redirected=*)
HTTPS_REDIRECTED=${OPTARG#*=} HTTPS_REDIRECTED=${OPTARG#*=}
opt=${OPTARG%=$val} opt=${OPTARG%=$val}
;; ;;
*) *)
echo "Warning: unknown option - $OPTARG" echo "Warning: unknown option - $OPTARG"
;; ;;
esac esac
;; ;;
@ -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#*=}
@ -69,7 +70,7 @@ do
;; ;;
*) *)
echo "Warning: unknown option - $OPTARG" echo "Warning: unknown option - $OPTARG"
;; ;;
esac esac
done done