SOLUTION: I am currently working on a project involving an express-gatsby app that needs to be built and deployed using GitHub Actions. To deploy it on Heroku, I have learned that containerizing the app is necessary. As a result, I have created a Dockerfile for this purpose. However, I seem to encounter difficulties during the build process as it gets stuck at npm run install.
If anyone has encountered similar issues or can provide any guidance on resolving this matter, your assistance would be highly appreciated. Thank you in advance.
Here is a screenshot of the docker build process
package.json
"scripts": {
"install": "npm install && cd /client && install",
"build": "cd client/ && npm run build && cd .. && node ./util/build.js",
"lint": "tslint --project \"tsconfig.json\"",
"start": "node -r module-alias/register ./dist",
"start:dev": "nodemon --config nodemon.json",
"test": "nodemon --config nodemon.test.json"
},
Dockerfile
FROM node:10-slim
WORKDIR /usr/src/app
RUN npm install -g gatsby-cli
COPY / ./
RUN npm run install
RUN npm run build
EXPOSE 8081
ENV NODE_ENV=production
ENV PORT=8081
RUN ls
CMD ["npm", "run", "start"]