From: Jérôme Benoit Date: Sat, 25 Sep 2021 11:01:46 +0000 (+0200) Subject: Add node.js memory tuning to docker image X-Git-Tag: v1.1.8~4 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=525935a5df9cd2b0ab4fc11c8231241bd9cb1b96;p=e-mobility-charging-stations-simulator.git Add node.js memory tuning to docker image Signed-off-by: Jérôme Benoit --- diff --git a/docker/Dockerfile b/docker/Dockerfile index 531bb43f..c1329905 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -13,8 +13,12 @@ RUN npm run build FROM node:lts-alpine +ARG MAX_OLD_SPACE_SIZE + WORKDIR /usr/app +ENV NODE_OPTIONS=--max-old-space-size=${MAX_OLD_SPACE_SIZE} + COPY --from=builder /usr/builder/node_modules ./node_modules COPY --from=builder /usr/builder/dist ./dist COPY README.md NOTICE LICENSE ./ diff --git a/docker/config.json b/docker/config.json index d49c4040..51c985d6 100644 --- a/docker/config.json +++ b/docker/config.json @@ -3,7 +3,6 @@ "ws://server:8010/OCPP16/5c866e81a2d9593de43efdb4" ], "distributeStationsToTenantsEqually": true, - "statisticsDisplayInterval": 60, "workerProcess": "workerSet", "workerPoolMinSize": 4, "workerPoolMaxSize": 16, @@ -37,5 +36,6 @@ "logRotate": false, "logConsole": false, "logFile": "/dev/stdout", - "logErrorFile": "/dev/stderr" + "logErrorFile": "/dev/stderr", + "logStatisticsInterval": 60 } diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index e34223d7..ebc8d8b9 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,12 +1,13 @@ version: '3.7' networks: - ev_network: - driver: bridge - + ev_network: + driver: bridge services: - charging-stations-simulator: - build: - context: .. - dockerfile: docker/Dockerfile - networks: - - ev_network + charging-stations-simulator: + build: + context: .. + dockerfile: docker/Dockerfile + args: + MAX_OLD_SPACE_SIZE: 1024 + networks: + - ev_network