The entrypoint script in the 12.14 base image requires the app to be mounted at /usr/local/src/app, and only runs npm install if this is the case.
The earlier images all ran npm install no matter what the mount path was, but after investigating why it turns out it was likely an unexpected bug. This is the relevant code from the earlier images:
if [[ -f /usr/local/src/app/yarn.lock ]]; then
echo "(Using Yarn because there is a yarn.lock file)"
su-exec node yarn install
else
su-exec node npm install --no-audit
fi
It's looking for yarn.lock in the required mount path, and if not found it runs npm install regardless of where the mount path is. Based on this code it seems the expectation was to only install npm dependencies at the one mount path as well, but some of our other projects were relying on this. Thus when it was "fixed" we had regressions. https://xkcd.com/1172/
Ultimately the entrypoint script should not care where you mount your application. We should make it mount-agnostic.
The entrypoint script in the 12.14 base image requires the app to be mounted at
/usr/local/src/app
, and only runsnpm install
if this is the case.The earlier images all ran
npm install
no matter what the mount path was, but after investigating why it turns out it was likely an unexpected bug. This is the relevant code from the earlier images:It's looking for yarn.lock in the required mount path, and if not found it runs
npm install
regardless of where the mount path is. Based on this code it seems the expectation was to only install npm dependencies at the one mount path as well, but some of our other projects were relying on this. Thus when it was "fixed" we had regressions. https://xkcd.com/1172/Ultimately the entrypoint script should not care where you mount your application. We should make it mount-agnostic.