My bad! Pressed Enter and wola it posted the bug.
Alrt so per best practices https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md
it is advised to => CMD["node", "server.js"]
I need to do CMD["node", "--max_old_space_size=${AM_MAX_MEMORY_SIZE}", "server.js"]
I am passing the AM_MAX_MEMORY_SIZE in the env file along with other params.
This doesn't work at all, I have tried adding the ARGS and ENV as well.
Assuming by env file, you mean using Docker Compose or docker run -e.
In order to get env interpolation, you'll need a shell:
So either of these should work:
# option 1
CMD ["sh", "-c", "exec node --max_old_space_size=${AM_MAX_MEMORY_SIZE} server.js"]
# option 2
# since this is without json syntax, it is equivalent to the CMD with "sh -c"
CMD exec node --max_old_space_size=${AM_MAX_MEMORY_SIZE} server.js
Most helpful comment
Assuming by env file, you mean using Docker Compose or
docker run -e.In order to get env interpolation, you'll need a shell:
So either of these should work: