I dont know if needed, but Im rebuild npm node_modules folder in my meteor project, deleting node_modules and calling meteor npm install and meteor npm rebuild.
by the way, we use this simple script in our CI to have always the correct image for meteor:
function ensureDockerfile() {
if [ ! -f Dockerfile ]; then
echo "Creating Dockerfile"
NODE_VERSION_FULL=$(cat bundle/.node_version.txt)
NODE_VERSION=${NODE_VERSION_FULL/v} # remove v
cat > Dockerfile <<EOF
FROM node:$NODE_VERSION
ADD . /src
RUN cd /src && rm -rf node_modules
RUN cd /src/bundle/programs/server && npm install
WORKDIR /src/bundle
EXPOSE 8888
CMD ["node", "main.js"]
EOF
fi
this is a bash function and could be called before doing a docker build. Make sure to adjust paths, etc.
We add the whole src code in this example because of some obscure reason. You can of course just add the bundle.