Skip to content

Commit

Permalink
Skal oppgradere til node 20 (#1726)
Browse files Browse the repository at this point in the history
  • Loading branch information
charliemidtlyng authored Aug 7, 2024
1 parent df6ad92 commit 125eaf8
Show file tree
Hide file tree
Showing 10 changed files with 318 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
cache: npm
registry-url: "https://npm.pkg.github.com"
- name: Npm install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_n_deploy_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
cache: npm
registry-url: "https://npm.pkg.github.com"
- name: Npm install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_n_deploy_prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
cache: npm
registry-url: "https://npm.pkg.github.com"
- name: Npm install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
cache: npm
registry-url: "https://npm.pkg.github.com"
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
cache: npm
registry-url: "https://npm.pkg.github.com"
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gcr.io/distroless/nodejs:18
FROM gcr.io/distroless/nodejs20-debian12

WORKDIR /app
COPY ./build build
Expand All @@ -8,4 +8,4 @@ WORKDIR /app/server
ENV NODE_ENV production
EXPOSE 8080

CMD ["--experimental-modules", "--es-module-specifier-resolution=node", "build/server.js"]
CMD ["--import=./build/register.js", "--es-module-specifier-resolution=node", "build/server.js"]
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
"build": "npm run lint && npm run build:prod",
"build:prod": "tsc & NODE_ENV=production PUBLIC_URL=/familie/alene-med-barn/soknad webpack --config ./config/webpack.build.js",
"build:dev": "tsc & NODE_ENV=development PUBLIC_URL=/familie/alene-med-barn/soknad webpack --config ./config/webpack.run.js",
"start": "npm run build:dev-server && NODE_ENV=development ENV=localhost PUBLIC_URL=/familie/alene-med-barn/soknad node --es-module-specifier-resolution=node --trace-deprecation server/build/server-lokal.js",
"start:preprod": "npm run build:dev-server && NODE_ENV=development BRUK_DEV_API=true ENV=localhost PUBLIC_URL=/familie/alene-med-barn/soknad node --es-module-specifier-resolution=node --trace-deprecation server/build/server-lokal.js",
"start:mock": "npm run build:dev-server && NODE_ENV=development ENV=localhost BRUK_MOCK_LOKALT=true PUBLIC_URL=/familie/alene-med-barn/soknad node --es-module-specifier-resolution=node --trace-deprecation server/build/server-lokal.js",
"start": "npm run build:dev-server && npm run set-node-options NODE_ENV=development ENV=localhost PUBLIC_URL=/familie/alene-med-barn/soknad node server/build/server-lokal.js",
"start:preprod": "npm run build:dev-server && npm run set-node-options NODE_ENV=development BRUK_DEV_API=true ENV=localhost PUBLIC_URL=/familie/alene-med-barn/soknad node server/build/server-lokal.js",
"start:mock": "npm run build:dev-server && npm run set-node-options NODE_ENV=development ENV=localhost BRUK_MOCK_LOKALT=true PUBLIC_URL=/familie/alene-med-barn/soknad node server/build/server-lokal.js",
"test": "vitest run",
"vitest": "vitest",
"lint": "tsc --project ./tsconfig.json --noEmit && eslint './src/**/*.{js,ts,tsx}'",
"build:dev-server": "cd server && tsc --build --verbose && cd ..",
"postinstall": "cd server && npm ci && cd .."
"postinstall": "cd server && npm ci && cd ..",
"set-node-options": "NODE_OPTIONS='--import=./server/build/register.js --es-module-specifier-resolution=node'"
},
"husky": {
"hooks": {
Expand Down
Loading

0 comments on commit 125eaf8

Please sign in to comment.