diff --git a/frameworks/JavaScript/fastify/app.js b/frameworks/JavaScript/fastify/app.js index 12b3aa0440c..3c93710e83d 100755 --- a/frameworks/JavaScript/fastify/app.js +++ b/frameworks/JavaScript/fastify/app.js @@ -1,11 +1,11 @@ const cluster = require("cluster"); -const physicalCpuCount = require("physical-cpu-count") +const numCPUs = require("os").cpus().length; if (cluster.isPrimary) { console.log(`Primary ${process.pid} is running`); // Fork workers. - for (let i = 0; i < physicalCpuCount; i++) { + for (let i = 0; i < numCPUs; i++) { cluster.fork(); } diff --git a/frameworks/JavaScript/fastify/fastify-mysql.dockerfile b/frameworks/JavaScript/fastify/fastify-mysql.dockerfile index 5a7848d77e2..dce82ff1a90 100644 --- a/frameworks/JavaScript/fastify/fastify-mysql.dockerfile +++ b/frameworks/JavaScript/fastify/fastify-mysql.dockerfile @@ -1,4 +1,4 @@ -FROM node:18.12.1-slim +FROM node:18.12.1-alpine COPY ./ ./ diff --git a/frameworks/JavaScript/fastify/fastify-postgres.dockerfile b/frameworks/JavaScript/fastify/fastify-postgres.dockerfile index 6d740699084..65bf195566d 100644 --- a/frameworks/JavaScript/fastify/fastify-postgres.dockerfile +++ b/frameworks/JavaScript/fastify/fastify-postgres.dockerfile @@ -1,4 +1,4 @@ -FROM node:18.12.1-slim +FROM node:18.12.1-alpine COPY ./ ./ diff --git a/frameworks/JavaScript/fastify/fastify.dockerfile b/frameworks/JavaScript/fastify/fastify.dockerfile index 88c1feef67c..fdd8dcf4946 100644 --- a/frameworks/JavaScript/fastify/fastify.dockerfile +++ b/frameworks/JavaScript/fastify/fastify.dockerfile @@ -1,4 +1,4 @@ -FROM node:18.12.1-slim +FROM node:18.12.1-alpine COPY ./ ./ diff --git a/frameworks/JavaScript/fastify/package.json b/frameworks/JavaScript/fastify/package.json index e7f103b0355..e0740139501 100644 --- a/frameworks/JavaScript/fastify/package.json +++ b/frameworks/JavaScript/fastify/package.json @@ -11,7 +11,6 @@ "knex": "2.4.2", "mongodb": "3.5.9", "mysql2": "2.2.5", - "pg": "8.5.1", - "physical-cpu-count": "^2.0.0" + "pg": "8.5.1" } }