From da7cd09244c8cb77893c3601ae2a2603b4f22934 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Fri, 24 Jan 2025 13:55:48 +0100 Subject: [PATCH] update dockerfiles --- admin/Dockerfile | 7 ++++--- backend/Dockerfile | 9 +++------ config/.nvmrc | 1 + config/src/commonSchema.ts | 4 ++-- frontend/Dockerfile | 6 +++--- 5 files changed, 13 insertions(+), 14 deletions(-) create mode 100644 config/.nvmrc diff --git a/admin/Dockerfile b/admin/Dockerfile index d0db3910c..2678c7c29 100644 --- a/admin/Dockerfile +++ b/admin/Dockerfile @@ -67,11 +67,12 @@ COPY ./admin/ . # Copy everything from config COPY ./config/ ../config/ +# yarn install and build config +RUN cd ../config && yarn install --production=false --frozen-lockfile --non-interactive && yarn build + # yarn install admin RUN yarn install --production=false --frozen-lockfile --non-interactive -# yarn install config -RUN cd ../config && yarn install --production=false --frozen-lockfile --non-interactive -RUN cd ../config && yarn build + # yarn build RUN yarn run build diff --git a/backend/Dockerfile b/backend/Dockerfile index 8bf65e300..de85f5db6 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -70,24 +70,21 @@ COPY ./database/ ../database/ # Copy everything from config COPY ./config/ ../config/ +# yarn install and build config +RUN cd ../config && yarn install --production=false --frozen-lockfile --non-interactive && yarn build + # yarn install backend RUN yarn install --production=false --frozen-lockfile --non-interactive # yarn install database RUN cd ../database && yarn install --production=false --frozen-lockfile --non-interactive -# yarn install config -RUN cd ../config && yarn install --production=false --frozen-lockfile --non-interactive - # yarn build RUN yarn build # yarn build database RUN cd ../database && yarn build -# yarn build config -RUN cd ../config && yarn build - ################################################################################## # TEST ########################################################################### ################################################################################## diff --git a/config/.nvmrc b/config/.nvmrc new file mode 100644 index 000000000..79bdb1b97 --- /dev/null +++ b/config/.nvmrc @@ -0,0 +1 @@ +v18.7.0 diff --git a/config/src/commonSchema.ts b/config/src/commonSchema.ts index 4b48e82bc..46264217b 100644 --- a/config/src/commonSchema.ts +++ b/config/src/commonSchema.ts @@ -2,7 +2,7 @@ import Joi from 'joi' export const browserUrls = Joi.array() .items(Joi.string().uri()) - .custom((value: Joi.string, helpers: Joi.helpers) => { + .custom((value: string[], helpers: Joi.CustomHelpers) => { const protocol = new URL(value[0]).protocol for (const url of value) { if (new URL(url).protocol !== protocol) { @@ -28,7 +28,7 @@ export const DB_VERSION = Joi.string() export const COMMUNITY_URL = Joi.string() .uri({ scheme: ['http', 'https'] }) - .custom((value: Joi.string, helpers: Joi.helpers) => { + .custom((value: string, helpers: Joi.CustomHelpers) => { if (value.endsWith('/')) { return helpers.error('any.invalid', { message: 'URL should not end with a slash (/)' }) } diff --git a/frontend/Dockerfile b/frontend/Dockerfile index e2d3239e6..96d0106bb 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -68,12 +68,12 @@ COPY ./frontend ./ # Copy everything from config COPY ./config/ ../config/ +# install and build config +RUN cd ../config && yarn install --production=false --frozen-lockfile --non-interactive && yarn build + # npm install RUN yarn global add node-gyp && yarn install --production=false --frozen-lockfile --non-interactive -# install and build config -RUN cd ../config && yarn install --production=false --frozen-lockfile --non-interactive -RUN cd ../config && yarn build # npm build RUN yarn run build