Category : node.js

I am using AWS lambda function with below code ‘use strict’; constchildProcess= require("child_process"); constpath= require("path"); const backupDatabase = () => { const scriptFilePath =path.resolve(__dirname, "./backup.sh"); return newPromise((resolve, reject) => { childProcess.execFile(scriptFilePath, (error) => { if (error) { console.error(error); resolve(false); } resolve(true); }); }); }; module.exports.handler = async (event) => { const isBackupSuccessful = await backupDatabase(); ..

Read more

I have this command to start a Node.js webserver like this: node –inspect=0.0.0.0:9229 –preserve-symlinks /app/api/dist/server.js | pino-pretty I’m placing it into a Dockerfile as the CMD: CMD ["node", "–inspect=0.0.0.0:9229", "–preserve-symlinks" ,"/app/api/dist/server.js", "|","pino-pretty"] The service starts when calling docker run but the | is ignored so no logs are forwarded to pino-pretty. What am I doing ..

Read more

I try to connect my container run node application with container database mysql, but not working… I’m not sure which host to use, maybe it’s some DNS error if I try to run the application outside the container I can access the database, but inside the container I can’t communicate with the database docker-compose.yml version: ..

Read more