diff --git a/Dockerfile b/Dockerfile index bdb0e90..e491ef1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ -FROM node:lts-alpine AS deps - +FROM node:22.11.0-alpine3.20 AS deps +ENV NPM_VERSION=10.3.0 +RUN npm install -g npm@"${NPM_VERSION}" WORKDIR /app COPY package.json ./ @@ -7,8 +8,10 @@ RUN npm install COPY . . -FROM node:lts-alpine AS builder +FROM node:22.11.0-alpine3.20 AS builder WORKDIR /app +ENV NPM_VERSION=10.3.0 +RUN npm install -g npm@"${NPM_VERSION}" COPY --from=deps /app ./ RUN rm -rf /app/data RUN rm -rf /app/__tests__ @@ -16,9 +19,11 @@ RUN rm -rf /app/__mocks__ RUN npm run build -FROM node:lts-alpine AS runner +FROM node:22.11.0-alpine3.20 AS runner WORKDIR /app -ENV NODE_ENV production +ENV NPM_VERSION=10.3.0 +RUN npm install -g npm@"${NPM_VERSION}" +ENV NODE_ENV=production RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs RUN set -xe && mkdir -p /app/data && chown nextjs:nodejs /app/data diff --git a/components/keywords/KeywordFilter.tsx b/components/keywords/KeywordFilter.tsx index 1c6da6d..9d6d9af 100644 --- a/components/keywords/KeywordFilter.tsx +++ b/components/keywords/KeywordFilter.tsx @@ -66,7 +66,10 @@ const KeywordFilters = (props: KeywordFilterProps) => { const optionObject:{label:string, value:string}[] = []; if (!isConsole) { - const allCountries = keywords.reduce((acc: string[], keyword) => [...acc, keyword.country], []).filter((t) => t && t.trim() !== ''); + const allCountries = Array.from(keywords as KeywordType[]) + .map((keyword) => keyword.country) + .reduce((acc, country) => [...acc, country], []) + .filter((t) => t && t.trim() !== ''); [...new Set(allCountries)].forEach((c) => optionObject.push({ label: countries[c][0], value: c })); } else { Object.keys(countries).forEach((countryISO:string) => {