From 25a63ce0a9e6355bfcfebc27ac6da3a408eb2ec0 Mon Sep 17 00:00:00 2001 From: Mirco Date: Thu, 7 Dec 2023 21:17:47 +0100 Subject: [PATCH] Improvements docker image building --- .gitlab-ci.yml | 6 +++--- .../excalidraw-backend/image/Dockerfile | 4 ++-- .../image/resources/install.sh | 15 +++++++++++---- infrastructure/web/image/Dockerfile | 2 +- infrastructure/web/image/resources/install.sh | 19 ++++++++++++------- project.clj | 2 +- 6 files changed, 30 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52d5239..fff85dd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ stages: - image .img: &img - image: "domaindrivenarchitecture/ddadevops-dind:4.7.2" + image: "domaindrivenarchitecture/ddadevops-dind:4.10.0" services: - docker:dind before_script: @@ -16,7 +16,7 @@ stages: - export IMAGE_TAG=$CI_COMMIT_TAG .cljs-job: &cljs - image: "domaindrivenarchitecture/ddadevops-clj-cljs:4.7.2" + image: "domaindrivenarchitecture/ddadevops-clj-cljs:4.10.0" cache: key: ${CI_COMMIT_REF_SLUG} paths: @@ -29,7 +29,7 @@ stages: - npm install .clj-job: &clj - image: "domaindrivenarchitecture/ddadevops-clj-cljs:4.7.2" + image: "domaindrivenarchitecture/ddadevops-clj-cljs:4.10.0" cache: key: ${CI_COMMIT_REF_SLUG} paths: diff --git a/infrastructure/excalidraw-backend/image/Dockerfile b/infrastructure/excalidraw-backend/image/Dockerfile index 8c26627..65b92c1 100644 --- a/infrastructure/excalidraw-backend/image/Dockerfile +++ b/infrastructure/excalidraw-backend/image/Dockerfile @@ -3,9 +3,9 @@ FROM node:20.10.0-bookworm-slim WORKDIR /excalidraw-backend -COPY resources/package.json resources/package-lock.json resources/tsconfig.json resources/install.sh resources/src ./ +COPY resources/package.json resources/package-lock.json resources/tsconfig.json resources/install.sh resources/src resources/install_functions.sh ./ -RUN ./install.sh +RUN DEBIAN_FRONTEND=noninteractive DEBCONF_NOWARNINGS=yes ./install.sh EXPOSE 80 EXPOSE 9090 diff --git a/infrastructure/excalidraw-backend/image/resources/install.sh b/infrastructure/excalidraw-backend/image/resources/install.sh index 3c6c4a2..3ca15fe 100755 --- a/infrastructure/excalidraw-backend/image/resources/install.sh +++ b/infrastructure/excalidraw-backend/image/resources/install.sh @@ -1,10 +1,17 @@ #!/bin/bash set -exo pipefail -apt-get update > /dev/null -apt-get -y upgrade > /dev/null -apt-get clean -rm -rf /var/lib/apt/lists/* +function main() { + { + apt-get update + apt-get -qqy upgrade + } > /dev/null + + cleanupDocker +} + +source ./install_functions.sh +main npm ci --omit=dev npm run build diff --git a/infrastructure/web/image/Dockerfile b/infrastructure/web/image/Dockerfile index 92bb39f..451d869 100644 --- a/infrastructure/web/image/Dockerfile +++ b/infrastructure/web/image/Dockerfile @@ -2,4 +2,4 @@ FROM jitsi/web:stable-9111 # Prepare Configuration ADD resources /tmp -RUN /tmp/install.sh +RUN DEBIAN_FRONTEND=noninteractive DEBCONF_NOWARNINGS=yes /tmp/install.sh diff --git a/infrastructure/web/image/resources/install.sh b/infrastructure/web/image/resources/install.sh index e04f912..e78b2b1 100755 --- a/infrastructure/web/image/resources/install.sh +++ b/infrastructure/web/image/resources/install.sh @@ -1,13 +1,18 @@ #!/bin/bash + set -exo pipefail -echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections +function main() { + { + apt-get update + apt-get -qqy upgrade + } > /dev/null -apt-get update > /dev/null -apt-get -qy upgrade > /dev/null -apt-get clean -rm -rf /var/lib/apt/lists/* + install -m 0700 /tmp/install-debug.sh /usr/local/bin/ + install -m 0644 /tmp/settings-config.js /defaults/settings-config.js + cleanupDocker +} -install -m 0700 /tmp/install-debug.sh /usr/local/bin/ -install -m 0644 /tmp/settings-config.js /defaults/settings-config.js \ No newline at end of file +source /tmp/install_functions.sh +main \ No newline at end of file diff --git a/project.clj b/project.clj index 7bda8bd..166a49e 100644 --- a/project.clj +++ b/project.clj @@ -23,7 +23,7 @@ :main dda.c4k-jitsi.uberjar :uberjar-name "c4k-jitsi-standalone.jar" :dependencies [[org.clojure/tools.cli "1.0.219"] - [ch.qos.logback/logback-classic "1.4.13" + [ch.qos.logback/logback-classic "1.4.14" :exclusions [com.sun.mail/javax.mail]] [org.slf4j/jcl-over-slf4j "2.0.9"]]}} :release-tasks [["test"]