Please advise how I can combine this commands in one but I don't need install npm in /opt/app-root folder
RUN chmod -R ug+rwx /opt/app-root
RUN chmod -R ug+rwx /app && npm i
Please advise how I can combine this commands in one but I don't need install npm in /opt/app-root folder
RUN chmod -R ug+rwx /opt/app-root
RUN chmod -R ug+rwx /app && npm i
You've already combined two commands on the second line; you can use the same method to combine the first and second lines.
RUN chmod -R ug+rwx /opt/app-root && chmod -R ug+rwx /app && npm i
You could also just give both arguments to chmod
at once though.
RUN chmod -R ug+rwx /opt/app-root /app && npm i