Last active
February 28, 2024 16:42
-
-
Save giuliohome/f8612fc663225d49be79296302c03ff6 to your computer and use it in GitHub Desktop.
alpine node container to build and test react without ssl verification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm set strict-ssl false | |
npm install npm@8.19.2 -g | |
cd my | |
yarn set version berry | |
yarn install | |
yarn build | |
yarn run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker build -t mynode16 . | |
docker run -it --rm localhost/mynode16 /bin/sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:16.14.0-alpine | |
RUN mkdir my | |
RUN echo enableStrictSsl: false > ./my/.yarnrc.yml | |
COPY fe-react-01/yarn.lock ./my | |
COPY fe-react-01/src ./my/src | |
COPY fe-react-01/.yarn ./my/.yarn | |
COPY fe-react-01/tsconfig.json ./my | |
COPY fe-react-01/package.json ./my | |
COPY fe-react-01/public ./my/public |
(unrelated to docker but ...)
In case of node error
set NODE_TLS_REJECT_UNAUTHORIZED=0
For node-gyp try this global installation from admin powershell.
npm install --global --production
npm install -g node-gyp
Or maybe find the component that requires it (firebase>grpc>node-gyp) and delete it... 😉
regarding a utility.js instead
function flow({happy_path, err_fnc}) {
try {
happy_path();
} catch (err) {
err_fnc(err);
}
}
function my_path() {
console.log('starting');
// throw 'my error';
console.log('ok!')
}
function my_err(err) {
console.log('catching')
console.error(err);
}
flow({
err_fnc: my_err,
happy_path: my_path
});
export OPENSSL_CONF=/etc/ssl/openssl.cnf
export SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION=1
does not work
solved ONLY with wifi hotspot instead of intranet usb-c and vpn on (even with NODE_TLS_REJECT_UNAUTHORIZED=1
and all the standard settings because in that case the internet certificates are as expected)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tips&Tricks
Use
to fix the
Error: unable to get local issuer certificate
foryarn set version berry