From d284f7b122e3a3a79d22cad2adcf6272658cbe81 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Fri, 24 Feb 2023 00:20:32 +0100 Subject: [PATCH 1/5] override command for intermediate containers to prevent execution of the container if command is defined --- deployment/docker-compose.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/deployment/docker-compose.yml b/deployment/docker-compose.yml index 0653d58f3..1fdfd9086 100644 --- a/deployment/docker-compose.yml +++ b/deployment/docker-compose.yml @@ -7,6 +7,7 @@ services: dockerfile: ../webapp/Dockerfile context: ../webapp target: base + command: sleep 0 webapp-code: image: ocelotsocialnetwork/webapp:local-code @@ -14,6 +15,7 @@ services: dockerfile: ../webapp/Dockerfile context: ../webapp target: code + command: sleep 0 webapp: image: ocelotsocialnetwork/webapp-branded:local-${CONFIGURATION} @@ -51,6 +53,7 @@ services: dockerfile: ../backend/Dockerfile context: ../backend target: base + command: sleep 0 backend-code: image: ocelotsocialnetwork/backend:local-code @@ -58,6 +61,7 @@ services: dockerfile: ../backend/Dockerfile context: ../backend target: code + command: sleep 0 backend: image: ocelotsocialnetwork/backend-branded:local-${CONFIGURATION} @@ -106,6 +110,7 @@ services: dockerfile: ../webapp/Dockerfile.maintenance context: ../webapp target: base + command: sleep 0 maintenance-code: image: ocelotsocialnetwork/maintenance:local-code @@ -113,6 +118,7 @@ services: dockerfile: ../webapp/Dockerfile.maintenance context: ../webapp target: code + command: sleep 0 maintenance: # name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there From 31e7be8ac97cd77184d03c00eec94d5e409e7663 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Fri, 24 Feb 2023 01:00:41 +0100 Subject: [PATCH 2/5] conflict with container naming in main docker-compose --- deployment/docker-compose.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deployment/docker-compose.yml b/deployment/docker-compose.yml index 1fdfd9086..a0dda4dc0 100644 --- a/deployment/docker-compose.yml +++ b/deployment/docker-compose.yml @@ -19,7 +19,7 @@ services: webapp: image: ocelotsocialnetwork/webapp-branded:local-${CONFIGURATION} - container_name: webapp + container_name: webapp-branded build: dockerfile: src/docker/webapp.Dockerfile target: branded @@ -68,7 +68,7 @@ services: container_name: backend build: dockerfile: src/docker/backend.Dockerfile - target: branded + target: branded-branded context: . args: - CONFIGURATION=$CONFIGURATION @@ -123,7 +123,7 @@ services: maintenance: # name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there image: ocelotsocialnetwork/maintenance-branded:local-${CONFIGURATION} - container_name: maintenance + container_name: maintenance-branded build: # TODO: Separate from webapp, this must be independent dockerfile: src/docker/maintenance.Dockerfile @@ -158,7 +158,7 @@ services: mailserver: image: djfarrelly/maildev - container_name: mailserver + container_name: mailserver-branded ports: - 1080:80 networks: From 8082bb0188be0128982afce59a9bc4b794e09558 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Fri, 24 Feb 2023 01:00:54 +0100 Subject: [PATCH 3/5] fix broken maintenance translation --- deployment/src/docker/maintenance.Dockerfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/deployment/src/docker/maintenance.Dockerfile b/deployment/src/docker/maintenance.Dockerfile index 1df6c551b..4ce817ae3 100644 --- a/deployment/src/docker/maintenance.Dockerfile +++ b/deployment/src/docker/maintenance.Dockerfile @@ -11,10 +11,17 @@ FROM $APP_IMAGE_CODE as code ARG CONFIGURATION=example +COPY src/tools/ tools/ + # copy public constants into the Docker image to brand it COPY configurations/${CONFIGURATION}/branding/static/ static/ COPY configurations/${CONFIGURATION}/branding/constants/ constants/ -COPY configurations/${CONFIGURATION}/branding/locales/ locales/ +COPY configurations/${CONFIGURATION}/branding/locales/*.json locales/tmp/ +# COPY configurations/${CONFIGURATION}/branding/locales/ locales/ + +RUN apk add --no-cache bash jq + +RUN tools/merge-locales.sh ################################################################################## # BUILD ########################################################################## From 18ccddeaf8f3d501b5e80810bfb7d8e65fc8aa40 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Fri, 24 Feb 2023 01:16:59 +0100 Subject: [PATCH 4/5] fix translatability of maintenance page --- webapp/plugins/i18n.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/plugins/i18n.js b/webapp/plugins/i18n.js index f162408f6..1382c2728 100644 --- a/webapp/plugins/i18n.js +++ b/webapp/plugins/i18n.js @@ -36,7 +36,7 @@ export default ({ app, req, cookie, store }) => { } const expires = new Date() - expires.setDate(expires.getDate() + app.$env.COOKIE_EXPIRE_TIME) + expires.setDate(expires.getDate() + app.$env && app.$env.COOKIE_EXPIRE_TIME) app.$cookies.set(key, localeInStore, { expires, // maxAge: app.$env.COOKIE_EXPIRE_TIME * 60 * 60 * 24, // days to seconds From ea3ac6f24dd5aeda4db99ce82b19f90a7e3b2ce5 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Fri, 24 Feb 2023 01:19:21 +0100 Subject: [PATCH 5/5] order file dockerfile commands correctly --- deployment/src/docker/maintenance.Dockerfile | 8 +++----- deployment/src/docker/webapp.Dockerfile | 7 +++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/deployment/src/docker/maintenance.Dockerfile b/deployment/src/docker/maintenance.Dockerfile index 4ce817ae3..b699e7f20 100644 --- a/deployment/src/docker/maintenance.Dockerfile +++ b/deployment/src/docker/maintenance.Dockerfile @@ -11,16 +11,14 @@ FROM $APP_IMAGE_CODE as code ARG CONFIGURATION=example -COPY src/tools/ tools/ - # copy public constants into the Docker image to brand it COPY configurations/${CONFIGURATION}/branding/static/ static/ COPY configurations/${CONFIGURATION}/branding/constants/ constants/ + +# locales COPY configurations/${CONFIGURATION}/branding/locales/*.json locales/tmp/ -# COPY configurations/${CONFIGURATION}/branding/locales/ locales/ - +COPY src/tools/ tools/ RUN apk add --no-cache bash jq - RUN tools/merge-locales.sh ################################################################################## diff --git a/deployment/src/docker/webapp.Dockerfile b/deployment/src/docker/webapp.Dockerfile index ad5b7c769..f0c75e392 100644 --- a/deployment/src/docker/webapp.Dockerfile +++ b/deployment/src/docker/webapp.Dockerfile @@ -12,17 +12,16 @@ FROM $APP_IMAGE_CODE as code ARG CONFIGURATION=example # copy public constants into the Docker image to brand it -COPY src/tools/ tools/ COPY configurations/${CONFIGURATION}/branding/static/ static/ COPY configurations/${CONFIGURATION}/branding/constants/ constants/ COPY configurations/${CONFIGURATION}/branding/locales/html/ locales/html/ -# COPY configurations/${CONFIGURATION}/branding/locales/index.js locales/index.js -COPY configurations/${CONFIGURATION}/branding/locales/*.json locales/tmp/ COPY configurations/${CONFIGURATION}/branding/assets/styles/imports/ assets/styles/imports/ COPY configurations/${CONFIGURATION}/branding/assets/fonts/ assets/fonts/ +# locales +COPY configurations/${CONFIGURATION}/branding/locales/*.json locales/tmp/ +COPY src/tools/ tools/ RUN apk add --no-cache bash jq - RUN tools/merge-locales.sh ##################################################################################