Skip to content
Snippets Groups Projects
Commit 3e4c8c98 authored by Moreau Nicolas's avatar Moreau Nicolas
Browse files

upgrade to nodejs20, update deprecated constructor in mongoose initialization

parent 19bd724b
Branches
Tags v23.9.1-dev
No related merge requests found
......@@ -3,18 +3,22 @@ FROM debian:bullseye-slim
# The version of nodejs
#FROM node:9
RUN apt-get -y update
RUN apt-get install -y apt-transport-https
# Adding wget and bzip2
RUN apt-get install -y wget \
bzip2
RUN apt-get -y update
RUN apt-get install -y apt-transport-https \
wget \
bzip2 \
curl \
sudo
RUN apt-get install -y sudo
RUN apt-get install -y ca-certificates curl gnupg
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update && sudo apt-get install nodejs -y
# Installing nodejs
RUN apt-get -y install curl
RUN curl --silent --location https://deb.nodesource.com/setup_16.x |sudo bash -
RUN apt-get -y install nodejs
# Add user partemix with no password, add to sudo group
......
......@@ -25,27 +25,9 @@ function getConnection(){
userAccess = '';
let url = config.get("dbSpectroscopy.host")+":"+config.get("dbSpectroscopy.port")+"/";
let urlConnection = 'mongodb://'+userAccess+url+config.get("dbSpectroscopy.dbName");
return createConnection(urlConnection, null);
return createConnection(urlConnection, {useUnifiedTopology:true, useNewUrlParser: true});
}
/*
var connectWithRetry = function() {
return mongoose.createConnection(urlConnection, function(err) {
if (err) {
console.error('Failed to connect to mongo on startup - retrying in 5 sec', err);
return setTimeout(connectWithRetry, 2000);
}
});
};
function getConnection(){
return connectWithRetry();
}
//var miningConnection = getConnection("dbPrimary.user", "dbPrimary.password", "dbPrimary.host", "dbPrimary.port", "dbPrimary.dbName");
*/
var spectroscopyConnection = getConnection();
......
......@@ -14,10 +14,10 @@
# We will use Debian for our image
FROM debian:bullseye-slim
#FROM node:14-bullseye-slim
RUN apt-get -y update
RUN apt-get install -y apt-transport-https
RUN apt-get install -y build-essential \
RUN apt-get -y update
RUN apt-get install -y apt-transport-https \
build-essential \
bzip2 \
curl \
pip \
......@@ -26,11 +26,16 @@ RUN apt-get install -y build-essential \
tcl-dev \
wget
RUN apt-get install -y ca-certificates curl gnupg
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update && sudo apt-get install nodejs -y
# Installing nodejs
RUN apt-get -y install curl
RUN curl --silent --location https://deb.nodesource.com/setup_16.x |sudo bash -
RUN apt-get -y install nodejs
RUN npm install npm@latest -g
#RUN npm config set registry http://registry.npmjs.org/ --global
#RUN npm cache clear --force
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment