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

Update to node 16 #1715

Merged
merged 21 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from 11 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jspm_packages

# Optional npm cache directory
.npm
.cache

# Optional REPL history
.node_repl_history
Expand Down
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
FROM node:14-alpine AS build
FROM node:16.20-alpine AS build
RUN apk add --no-cache make gcc g++ python3 bash git openssh jq
WORKDIR /app
COPY ./package.json /app
COPY ./package-lock.json /app
COPY ./packages /app/packages

RUN npm install
RUN npm install --legacy-peer-deps
# see .dockerignore to know all copied files
COPY . /app/

ENV NODE_ENV="production"
ENV CYPRESS_CACHE_FOLDER=/app/.cache
ENV npm_config_cache=/app/.npm

RUN mkdir /app/upload && \
cp -n ./config/production-dist.js ./config/production.js && \
Expand All @@ -18,7 +20,7 @@ RUN mkdir /app/upload && \
npm prune --production && \
npm run clean

FROM node:14-alpine AS release
FROM node:16.20-alpine AS release
RUN apk add --no-cache su-exec redis
COPY --from=build /app /app

Expand Down
6 changes: 4 additions & 2 deletions Dockerfile.spec
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
FROM node:14-alpine
FROM node:16.20-alpine

WORKDIR /app
COPY ./package.json /app
COPY ./package-lock.json /app
COPY ./packages /app/packages

RUN npm install
RUN npm install --legacy-peer-deps
# see .dockerignore to know all copied files
COPY . /app/

ARG node_env="production"
ENV NODE_ENV=$node_env
ENV CYPRESS_CACHE_FOLDER=/app/.cache
ENV npm_config_cache=/app/.npm

RUN mkdir /app/upload && \
cp -n ./config/production-dist.js ./config/production.js && \
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ endif
install-npm-dependencies:
echo "Installing Node dependencies"
ifeq "$(CI)" "true"
docker compose -f docker-compose.dev.yml run --no-deps --rm node npm ci
docker compose -f docker-compose.dev.yml run --no-deps --rm node npm ci --legacy-peer-deps
else
docker compose -f docker-compose.dev.yml run --no-deps --rm node npm install
docker compose -f docker-compose.dev.yml run --no-deps --rm node npm install --legacy-peer-deps
endif

install: copy-conf install-npm-dependencies ## Install npm dependencies for the node, admin, and frontend apps
Expand Down
17 changes: 13 additions & 4 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ version: '3'

services:
node:
image: node:14
image: node:16.20-bullseye
volumes:
- .:/app
working_dir: /app
user: '${UID}:${GID}'
environment:
npm_config_cache: /app/.npm
CYPRESS_CACHE_FOLDER: /app/.cache
MONGOMS_DOWNLOAD_DIR: /app/.cache/mongodb-binaries
DEBUG: ${DEBUG}
NODE_ENV: ${NODE_ENV}
NODE_OPTIONS: ${NODE_OPTIONS}
Expand All @@ -32,19 +35,22 @@ services:
command: npm run development:api

dev-server: ## Enable hot-reload in development
image: node:14
image: node:16.20-bullseye
volumes:
- .:/app
- ./.cache:/root/.cache
working_dir: /app
user: '${UID}:${GID}'
environment:
npm_config_cache: /app/.npm
CYPRESS_CACHE_FOLDER: /app/.cache
NODE_ENV: development
ports:
- "8080:8080"
command: npm run development:app

mongo:
image: mongo:4.4.4-bionic
image: mongo:4.4.24-focal
ports:
- "27017:27017"

Expand All @@ -54,12 +60,15 @@ services:
- "6379:6379"

workers:
image: node:14
image: node:16.20-bullseye
volumes:
- .:/app
- ./.cache:/root/.cache
working_dir: /app
user: '${UID}:${GID}'
environment:
npm_config_cache: /app/.npm
CYPRESS_CACHE_FOLDER: /app/.cache
DEBUG: ${DEBUG}
NODE_ENV: ${NODE_ENV}
NODE_OPTIONS: ${NODE_OPTIONS}
Expand Down
12 changes: 9 additions & 3 deletions docker-compose.spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ services:
node_env: e2e
environment:
NODE_ENV: 'e2e'
npm_config_cache: /app/.npm
CYPRESS_CACHE_FOLDER: /app/.cache
EZMASTER_PUBLIC_URL: ${EZMASTER_PUBLIC_URL}
EZMASTER_MONGODB_HOST_PORT: mongo:27017
EXPOSE_TEST_CONTROLLER: 'true'
Expand All @@ -28,9 +30,10 @@ services:
- ./cypress/mocks/external:/app/external

istex-api:
image: node:14
image: node:16.20-bullseye
volumes:
- .:/app
- ./.cache:/root/.cache
working_dir: /app
user: '${UID}:${GID}'
environment:
Expand All @@ -40,7 +43,7 @@ services:
command: node --require @babel/register ./cypress/mocks/istexApi.js

mongo:
image: mongo:4.4.4-bionic
image: mongo:4.4.24-focal
ports:
- "27017:27017"

Expand All @@ -50,12 +53,15 @@ services:
- "6379:6379"

workers:
image: node:14
image: node:16.20-bullseye
volumes:
- .:/app
- ./.cache:/root/.cache
working_dir: /app
user: '${UID}:${GID}'
environment:
npm_config_cache: /app/.npm
CYPRESS_CACHE_FOLDER: /app/.cache
DEBUG: ${DEBUG}
NODE_ENV: ${NODE_ENV}
NODE_OPTIONS: ${NODE_OPTIONS}
Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ services:
build:
context: .
environment:
npm_config_cache: /app/.npm
CYPRESS_CACHE_FOLDER: /app/.cache
http_proxy: ${http_proxy}
https_proxy: ${https_proxy}
NODE_OPTIONS: ${NODE_OPTIONS}
Expand All @@ -21,6 +23,6 @@ services:
ports:
- "3000:3000"
mongo:
image: mongo:4.4.4-bionic
image: mongo:4.4.24-focal
ports:
- "27017:27017"
2 changes: 1 addition & 1 deletion globalConfig.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"mongoUri":"mongodb://127.0.0.1:43217/jest?","mongoDBName":"jest"}
{"mongoUri":"mongodb://127.0.0.1:33399/","mongoDBName":"jest"}
2 changes: 1 addition & 1 deletion jest-mongodb-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
dbName: 'jest',
},
binary: {
version: '4.4.4',
version: '4.4.24',
skipMD5: true,
},
autoStart: false,
Expand Down
Loading