Skip to content

Commit

Permalink
fix: Fixes Docker build issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
towfiqi committed Nov 10, 2024
1 parent 5507cac commit 1bef758
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
15 changes: 10 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
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 ./
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__
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
Expand Down
5 changes: 4 additions & 1 deletion components/keywords/KeywordFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string[]>((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) => {
Expand Down

0 comments on commit 1bef758

Please sign in to comment.