If I'm building microservices using Node on Docker images - it's necessary to keep an idea of what version of Node I'm using.
The idea is - I'm going to be running Node locally in development - and then it still needs to work when running on a container.
If my Dockerfile looks like this:
# Create app directory
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
RUN npm install
# If you are building your code for production
# RUN npm install --only=production
# Bundle app source
COPY . .
CMD [ "npm", "start" ]
This is fine - except my local environment doesn't know which version of node I'm using.
Now I could just put
10.10 in my
But then I have to remember to keep these in sync. Is there a better way to do it? Is there a node:alpine that respects .nvmrc?