From 702a2c78566eafac818515ab1cb8a2b16e8c9396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Fuhlbr=C3=BCck?= Date: Tue, 12 Mar 2024 12:49:58 +0100 Subject: [PATCH 1/4] use temurin to provide jre-11 in bookworm (sencha requires Nashorn for JS) --- Dockerfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1631a853..db74506f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,9 +22,16 @@ ENV OPENSSL_CONF /etc/ssl/ # # Install required packages # +RUN apt-get -qq update && apt install -y wget apt-transport-https gpg +RUN wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor | tee /etc/apt/trusted.gpg.d/adoptium.gpg > /dev/null +RUN echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list + + + + RUN mkdir -p /usr/share/man/man1/ && apt-get -qq update && apt-get -qq install \ - curl unzip default-jre-headless git libapache2-mod-shib && \ + curl unzip temurin-11-jre git libapache2-mod-shib && \ apt-get -qq clean && rm -rf /var/lib/apt/lists/* EXPOSE 80 81 82 83 84 From 9b3015887adde1a6be34a24fdcc80d3b2caf8579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Fuhlbr=C3=BCck?= Date: Tue, 12 Mar 2024 13:12:19 +0100 Subject: [PATCH 2/4] docker: use multi-stage build --- Dockerfile | 49 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index db74506f..7d240ad2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ # The LADA-application will be available under http://yourdockerhost:8182 # -FROM httpd:2.4 +FROM httpd:2.4 AS build MAINTAINER mlechner@bfs.de ENV DEBIAN_FRONTEND noninteractive @@ -31,24 +31,14 @@ RUN echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION RUN mkdir -p /usr/share/man/man1/ && apt-get -qq update && apt-get -qq install \ - curl unzip temurin-11-jre git libapache2-mod-shib && \ + curl unzip temurin-11-jre git && \ apt-get -qq clean && rm -rf /var/lib/apt/lists/* -EXPOSE 80 81 82 83 84 -CMD ["httpd-foreground"] -# -# httpd setup -# -RUN sed -i -e "/^#LoadModule proxy_module/s/#//;/^#LoadModule proxy_http_module/s/#//;/^#LoadModule deflate_module/s/#//;/^#Include conf.*httpd-vhosts.conf/s/#//" $HTTPD_PREFIX/conf/httpd.conf RUN mkdir /usr/local/lada -RUN rm -rf /usr/local/apache2/htdocs && ln -s /usr/local/lada/ /usr/local/apache2/htdocs WORKDIR /usr/local/lada -ADD custom-vhosts.conf ./ -RUN ln -sf $PWD/custom-vhosts.conf $HTTPD_PREFIX/conf/extra/httpd-vhosts.conf - ADD *.sh /usr/local/lada/ # @@ -76,3 +66,38 @@ RUN sed -i -e "/Lada.clientVersion/s/';/ $(git rev-parse --short HEAD)';/" app.j # RUN echo build $(grep Lada.clientVersion app.js | cut -d '=' -f 2 | cut -d "'" -f 2) && ./docker-build-app.sh + + +FROM httpd:2.4 +MAINTAINER mlechner@bfs.de + +ENV DEBIAN_FRONTEND noninteractive +ENV OPENSSL_CONF /etc/ssl/ + +# +# Install required packages +# + +RUN mkdir -p /usr/share/man/man1/ && apt-get -qq update && apt-get -qq install \ + libapache2-mod-shib && \ + apt-get -qq clean && rm -rf /var/lib/apt/lists/* + +EXPOSE 80 81 82 83 84 + +CMD ["httpd-foreground"] +# +# httpd setup +# +RUN sed -i -e "/^#LoadModule proxy_module/s/#//;/^#LoadModule proxy_http_module/s/#//;/^#LoadModule deflate_module/s/#//;/^#Include conf.*httpd-vhosts.conf/s/#//" $HTTPD_PREFIX/conf/httpd.conf + +COPY --from=build /usr/local/lada /usr/local/lada +RUN rm -rf /usr/local/apache2/htdocs && ln -s /usr/local/lada/ /usr/local/apache2/htdocs +WORKDIR /usr/local/lada + +ADD custom-vhosts.conf ./ +RUN ln -sf $PWD/custom-vhosts.conf $HTTPD_PREFIX/conf/extra/httpd-vhosts.conf + + + + + From 5826bf80e557b359b3ad9b9985b43f5d9e900d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Fuhlbr=C3=BCck?= Date: Tue, 12 Mar 2024 14:18:45 +0100 Subject: [PATCH 3/4] use debian 11 instead of httpd for build (has jre-11) --- Dockerfile | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7d240ad2..39dd6d12 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,25 +13,16 @@ # The LADA-application will be available under http://yourdockerhost:8182 # -FROM httpd:2.4 AS build +FROM debian:11-slim AS build MAINTAINER mlechner@bfs.de ENV DEBIAN_FRONTEND noninteractive -ENV OPENSSL_CONF /etc/ssl/ - +ENV OPENSSL_CONF=/etc/ssl/ # # Install required packages # -RUN apt-get -qq update && apt install -y wget apt-transport-https gpg -RUN wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor | tee /etc/apt/trusted.gpg.d/adoptium.gpg > /dev/null -RUN echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list - - - - - RUN mkdir -p /usr/share/man/man1/ && apt-get -qq update && apt-get -qq install \ - curl unzip temurin-11-jre git && \ + curl unzip openjdk-11-jre-headless git && \ apt-get -qq clean && rm -rf /var/lib/apt/lists/* @@ -68,7 +59,7 @@ RUN sed -i -e "/Lada.clientVersion/s/';/ $(git rev-parse --short HEAD)';/" app.j RUN echo build $(grep Lada.clientVersion app.js | cut -d '=' -f 2 | cut -d "'" -f 2) && ./docker-build-app.sh -FROM httpd:2.4 +FROM httpd:2.4 AS deploy MAINTAINER mlechner@bfs.de ENV DEBIAN_FRONTEND noninteractive From c0d76d7ec50ae69b26f6a184d793e354817cacec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Fuhlbr=C3=BCck?= Date: Tue, 12 Mar 2024 14:34:51 +0100 Subject: [PATCH 4/4] minor chnanges in Dockerfile --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 39dd6d12..7d2eb07c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,11 +18,12 @@ MAINTAINER mlechner@bfs.de ENV DEBIAN_FRONTEND noninteractive ENV OPENSSL_CONF=/etc/ssl/ + # # Install required packages # RUN mkdir -p /usr/share/man/man1/ && apt-get -qq update && apt-get -qq install \ - curl unzip openjdk-11-jre-headless git && \ + curl unzip openjdk-11-jre-headless git && \ apt-get -qq clean && rm -rf /var/lib/apt/lists/*