The issue with the failing task is related to your first COPY instruction: COPY package.json /.
This command copies the package.json file to the root directory of the image, specifically at /package.json. Since you have set your working directory to /opt/app and are copying server.js to that location, the dependencies specified in package.json will not be available in the working directory.
To resolve this, you should update your first COPY instruction to: COPY package.json .
This modification will copy package.json into your working directory (/opt/app), ensuring that the dependencies are accessible when you run your application with server.js.
PS: Once deployed, you can test the app using a curl command on relevant App Server. curl http://localhost:8092
Thank you for the quick reply. You’re right, that was a typo from my end and I didn’t notice it.
I think the reason why I didn’t notice that mistake was the fact the application worked when I tested it with curl and didn’t drop any error, it’s like the dependencies didn’t matter?
The fact that the image was named correctly and the curl worked fine confused me and I didn’t know what was the error