Hello everyone. Can somebody help me why this Doc...
# orm-help
j
Hello everyone. Can somebody help me why this Dockerfile cannot recognise the command “yarn production” ? [[PM2][ERROR] Script not found: /app/production
r
@Jin 👋 You would need to use this in Docker
j
yes There is PM2 install command in my dockerfile. I think its an error about Yarn command in ENTRYPOINT. do you have any idea?
r
The command should be
pm2-runtime
and not just
pm2
.
j
ah is it? so should I write like this? ENTRYPOINT[ "npm", "pm2-runtime", "start", "yarn", "production" ]
my error message seems like PM2 is running but failed to run yarn production command since I can see the fancy PM2 logo
r
This command works for me:
Copy code
CMD [ "pm2-runtime", "start", "npm -- start" ]
j
but i want to run my yarn script "yarn production"
r
yarn
might have problems with this, try running
npm run production
or directly embed the file that you’re running in the
production
script.
j
oh I just noticed you are using CMD command instead of ENTRYPOINT . I am gonna try it out. Thank you so much! 👍
r
For a custom command this works, just tried:
Copy code
CMD [ "pm2-runtime", "start", "yarn --interpreter bash production" ]
j
ah~~ i will try it out thank you so much👍👍
🙌 1