diff --git a/deployment/docker-compose.yml b/deployment/docker-compose.yml index 0653d58f3..a0dda4dc0 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,10 +15,11 @@ services: dockerfile: ../webapp/Dockerfile context: ../webapp target: code + command: sleep 0 webapp: image: ocelotsocialnetwork/webapp-branded:local-${CONFIGURATION} - container_name: webapp + container_name: webapp-branded build: dockerfile: src/docker/webapp.Dockerfile target: branded @@ -51,6 +53,7 @@ services: dockerfile: ../backend/Dockerfile context: ../backend target: base + command: sleep 0 backend-code: image: ocelotsocialnetwork/backend:local-code @@ -58,13 +61,14 @@ services: dockerfile: ../backend/Dockerfile context: ../backend target: code + command: sleep 0 backend: image: ocelotsocialnetwork/backend-branded:local-${CONFIGURATION} container_name: backend build: dockerfile: src/docker/backend.Dockerfile - target: branded + target: branded-branded context: . args: - CONFIGURATION=$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,11 +118,12 @@ 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 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 @@ -152,7 +158,7 @@ services: mailserver: image: djfarrelly/maildev - container_name: mailserver + container_name: mailserver-branded ports: - 1080:80 networks: diff --git a/deployment/src/docker/maintenance.Dockerfile b/deployment/src/docker/maintenance.Dockerfile index 1df6c551b..b699e7f20 100644 --- a/deployment/src/docker/maintenance.Dockerfile +++ b/deployment/src/docker/maintenance.Dockerfile @@ -14,7 +14,12 @@ ARG CONFIGURATION=example # 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/ + +# 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 ################################################################################## # BUILD ########################################################################## 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 ################################################################################## 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