Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sonar fixes #2835

Merged
merged 8 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
FROM node:18-alpine as builder

WORKDIR /app

COPY assets ./assets
COPY node_modules ./node_modules
COPY build_n_deploy ./build_n_deploy
COPY node_dist ./node_dist
COPY frontend_production ./frontend_production
COPY package.json .

FROM gcr.io/distroless/nodejs:18

WORKDIR /var/server

ADD assets ./assets
ADD node_modules ./node_modules
ADD build_n_deploy ./build_n_deploy
ADD node_dist ./node_dist
ADD frontend_production ./frontend_production
ADD package.json .
COPY --from=builder /app/assets ./assets
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/build_n_deploy ./build_n_deploy
COPY --from=builder /app/node_dist ./node_dist
COPY --from=builder /app/frontend_production ./frontend_production
COPY --from=builder /app/package.json .

ENV NODE_ENV production

EXPOSE 8000
CMD ["--es-module-specifier-resolution=node", "node_dist/backend/server.js"]

CMD ["--es-module-specifier-resolution=node", "node_dist/backend/server.js"]
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ export const utledYngsteBarnFødselsdatoSomHarInngangsvilkåretAleneomsorgOppfyl
.map((b) => b?.registergrunnlag.fødselsdato)
.filter((fødselsdato): fødselsdato is string => !!fødselsdato && erGyldigDato(fødselsdato))
.concat(terminbarnFødselsdatoer);

if (datoer.length === 0) {
return undefined;
}

return datoer.reduce((a, b) => {
return erEtter(a, b) ? a : b;
});
}, datoer[0]);
};