skip to Main Content

I need to run nodejs project (which is a server of a react app) on a docker container and i cant find a npm command that would create a dist folder to put in the dockerfile.
i would very much appreciate any help!

2

Answers


  1. Usually the dist/ folder is created by the build tool (webpack, vite, parcel, etc). So there’s no command that just says "create this directory." If you’re using create-react-app then it would be npm run build but I believe CRA is actually outputting to a build/ directory and not dist/.

    Really it just depends on what you’re wanting to do exactly. Are you looking for a command to build the application for the docker file? Are you looking to just have a path? etc.

    Login or Signup to reply.
  2. I know you’re using react. But this answer is for the Angular folks because I had the same question, but for Angular.

    You type in this command –

    ng build
    

    That will create the dist folder.

    Documentation can be found here –
    https://angular.io/guide/deployment#building-and-serving-from-disk

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search