diff --git a/.github/workflows/aws-frontend-deploy.yml b/.github/workflows/aws-frontend-deploy.yml index 9b2b2bbe1..2ca6e0f7c 100644 --- a/.github/workflows/aws-frontend-deploy.yml +++ b/.github/workflows/aws-frontend-deploy.yml @@ -48,6 +48,11 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ github.event.inputs.ref }} + - name: Checkout + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: 'npm' - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v2 with: diff --git a/.nvmrc b/.nvmrc index b6a7d89c6..3c032078a 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16 +18 diff --git a/backend/Dockerfile.api b/backend/Dockerfile.api index fcaaf6294..6b2f7576b 100644 --- a/backend/Dockerfile.api +++ b/backend/Dockerfile.api @@ -1,4 +1,4 @@ -FROM node:14.11.0 AS api-development +FROM node:18.12.0 AS api-development RUN mkdir /srv/backend WORKDIR /srv/backend RUN mkdir -p node_modules @@ -6,14 +6,14 @@ COPY package.json yarn.lock ./ RUN yarn install --pure-lockfile COPY . . -FROM node:14.11.0 AS api-test +FROM node:18.12.0 AS api-test RUN mkdir /srv/backend WORKDIR /srv/backend COPY package.json yarn.lock ./ RUN yarn install --silent RUN mkdir -p node_modules -FROM node:14.11.0-slim AS api-production +FROM node:18.12.0-slim AS api-production EXPOSE 4000 USER node WORKDIR /srv/backend diff --git a/backend/Dockerfile.dev b/backend/Dockerfile.dev index bcffe803f..c1afb2054 100644 --- a/backend/Dockerfile.dev +++ b/backend/Dockerfile.dev @@ -1,4 +1,4 @@ -FROM node:14.11.0 AS api-development +FROM node:18.12.0 AS api-development RUN mkdir /srv/backend WORKDIR /srv/backend RUN mkdir -p node_modules diff --git a/backend/Dockerfile.prod b/backend/Dockerfile.prod index 7bccfd0df..382e9350b 100644 --- a/backend/Dockerfile.prod +++ b/backend/Dockerfile.prod @@ -1,4 +1,4 @@ -FROM node:14.11.0 AS api-builder +FROM node:18.12.0 AS api-builder RUN mkdir /srv/backend WORKDIR /srv/backend RUN mkdir -p node_modules @@ -6,7 +6,7 @@ COPY package.json yarn.lock ./ RUN yarn install --pure-lockfile COPY . . -FROM node:14.11.0-slim AS api-production +FROM node:18.12.0-slim AS api-production EXPOSE 4000 USER node WORKDIR /srv/backend diff --git a/backend/globalConfig.json b/backend/globalConfig.json index 0c381857a..24feb73f9 100644 --- a/backend/globalConfig.json +++ b/backend/globalConfig.json @@ -1 +1 @@ -{"mongoUri":"mongodb://127.0.0.1:63857/jest?","mongoDBName":"jest"} \ No newline at end of file +{"mongoUri":"mongodb://127.0.0.1:53806/jest?","mongoDBName":"jest"} \ No newline at end of file diff --git a/backend/models/project.test.js b/backend/models/project.test.js index 8cefa3138..0f00cdc7c 100644 --- a/backend/models/project.test.js +++ b/backend/models/project.test.js @@ -1,7 +1,10 @@ const { Project } = require('./project.model'); const { setupDB } = require("../setup-test"); -setupDB("project-model"); + +beforeAll(async () => { + await setupDB("user-model"); +}); describe("Project Model saves the correct values", () => { test("Save a model instance and then read from the db", async (done) => { diff --git a/backend/models/user.test.js b/backend/models/user.test.js index 97ef50d35..e2325f0bd 100644 --- a/backend/models/user.test.js +++ b/backend/models/user.test.js @@ -1,7 +1,10 @@ const { User } = require('./user.model'); const { setupDB } = require("../setup-test"); -setupDB("user-model"); + +beforeAll(async () => { + await setupDB("user-model"); +}); // Please add and expand on this simple test. describe("Question Model saves the correct values", () => { diff --git a/client/Dockerfile.client b/client/Dockerfile.client index 971f93ddb..0268eedfe 100644 --- a/client/Dockerfile.client +++ b/client/Dockerfile.client @@ -1,4 +1,4 @@ -FROM node:14.11.0 AS client-development +FROM node:18-alpine AS client-development RUN mkdir /srv/client && chown node:node /srv/client WORKDIR /srv/client USER node @@ -6,7 +6,7 @@ RUN mkdir -p node_modules COPY --chown=node:node package.json package.json ./ RUN npm install --silent -FROM node:14.11.0-slim AS client-builder +FROM node:18.12.0-slim AS client-builder USER node WORKDIR /srv/client COPY --from=client-development /srv/client/node_modules node_modules diff --git a/client/Dockerfile.dev b/client/Dockerfile.dev index 0ae20b4cb..879ba998a 100644 --- a/client/Dockerfile.dev +++ b/client/Dockerfile.dev @@ -1,4 +1,4 @@ -FROM node:14.11.0 AS client-development +FROM node:18-alpine AS client-development RUN mkdir /srv/client && chown node:node /srv/client WORKDIR /srv/client USER node diff --git a/client/Dockerfile.prod b/client/Dockerfile.prod index cac246b85..b724fb80b 100644 --- a/client/Dockerfile.prod +++ b/client/Dockerfile.prod @@ -1,12 +1,12 @@ -FROM node:14.11.0 AS node-modules-install +FROM node:20-alpine AS node-modules-install RUN mkdir /srv/client && chown node:node /srv/client WORKDIR /srv/client USER node RUN mkdir -p node_modules COPY --chown=node:node package.json package.json ./ -RUN npm install --silent +RUN npm install --no-update-notifier -FROM node:14.11.0-slim AS client-builder +FROM node:18-slim AS client-builder USER node WORKDIR /srv/client COPY --from=node-modules-install /srv/client/node_modules node_modules diff --git a/client/public/index.html b/client/index.html similarity index 86% rename from client/public/index.html rename to client/index.html index b0f3060f0..da21cf20c 100644 --- a/client/public/index.html +++ b/client/index.html @@ -2,7 +2,7 @@
- + - + @@ -33,6 +33,7 @@ +