From 23ff9d5fe82f3db461bbd4e38c6dbd65238267bf Mon Sep 17 00:00:00 2001 From: casjay Date: Tue, 11 Oct 2022 17:47:56 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 16 +++++++++++----- bin/cherokee-server | 4 +++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index f546c16..a66576c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,19 +15,22 @@ RUN apk -U upgrade && \ gettext \ git \ libtool \ - openssl \ - openssl-dev \ + openssl3 \ + openssl3-dev \ linux-headers \ rrdtool \ ffmpeg-dev \ geoip-dev \ php8-cgi -RUN cd /tmp/build && \ +RUN mkdir -p "/usr/local/share/template-files/config/cherokee/defaults" "/buildroot" && \ + cd /tmp/build && \ git clone https://github.com/cherokee/webserver.git . && \ /usr/bin/libtoolize && \ aclocal && autoheader && touch ./ChangeLog ./README && autoconf && \ - ./autogen.sh --prefix=/usr/local/share/cherokee --sysconfdir=/usr/local/share/cherokee/etc --localstatedir=/usr/local/share/cherokee/var --enable-static-module=all && \ + ./autogen.sh --prefix=/usr/local/share/cherokee --sysconfdir=/usr/local/share/cherokee/etc \ + --localstatedir=/usr/local/share/cherokee/var --enable-static-module=all --enable-static \ + --enable-shared=no && \ autoreconf -iv && \ make && make install && \ echo "

Built from $(git rev-parse --short HEAD) on $(date)

" > ./version.txt && \ @@ -44,12 +47,15 @@ RUN cd /tmp/build && \ openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=US/ST=CA/L=CA/O=Cherokee/OU=Cherokee/CN=localhost" -keyout /etc/ssl/key.pem -out /etc/ssl/crt.pem && \ ln -sf /usr/local/share/cherokee/bin/* /usr/local/bin/ && \ ln -sf /usr/local/share/cherokee/sbin/* /usr/local/bin/ && \ - mkdir -p /buildroot && \ + cp -Rf "/usr/local/share/cherokee/etc/." "/usr/local/share/template-files/config/cherokee/defaults/" cp -Rf "/usr/local/." "/buildroot/" && \ rm -Rf /var/cache/apk/* /tmp/* /var/tmp/* /tmp/build /usr/src/* FROM casjaysdevdocker/php:latest AS source +RUN apk add --no-cache geoip rrdtool openssl3 && \ + rm -Rf /var/cache/apk/* /tmp/* /var/tmp/* + COPY --from=build /buildroot/. /usr/local/ COPY ./bin/. /usr/local/bin/ COPY ./data/. /usr/local/share/template-files/data/ diff --git a/bin/cherokee-server b/bin/cherokee-server index 25a307d..bc1573d 100755 --- a/bin/cherokee-server +++ b/bin/cherokee-server @@ -12,6 +12,8 @@ if [ ! -d "/config/cherokee" ] && [ -d "/usr/local/share/template-files/config/c cp -Rf "/usr/local/share/template-files/config/cherokee/." "/config/cherokee/" fi # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +[ -d "/config/cherokee" ] && cp -Rf "/config/cherokee/." "/etc/cherokee/" || cp -Rf "/usr/local/share/template-files/config/defaults/cherokee/" "/etc/cherokee/" +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ -d "/data/htdocs" ] || mkdir -p "/data/htdocs" if [ -z "$(ls -A /data/htdocs/www/* 2>/dev/null||echo '')" ]; then mkdir -p "/data/htdocs" "/data/htdocs/cgi-bin" @@ -28,6 +30,6 @@ fi # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if [ ! -f "/tmp/cherokee.pid" ]; then cherokee-admin -b -p 9090 -c /etc/cherokee/cherokee.conf & - exec cherokee -c /etc/cherokee/cherokee.conf || rm -Rf "/tmp/cherokee.pid" + exec cherokee -C /etc/cherokee/cherokee.conf || rm -Rf "/tmp/cherokee.pid" fi