Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # install static server
- RUN npm install -g serve
- # create a 'tmp' folder for the build and make it the current working directory
- WORKDIR /app/tmp
- # copy only the package.json to take advantage of cached Docker layers
- COPY package.json .
- # install project dependencies
- RUN npm install
- # copy project files and folders to the working directory
- COPY . .
- # build for production with minification
- RUN npm run build
- # make the 'app' folder the current working directory
- WORKDIR /app
- # clean up (i.e. extract 'dist' folder and remove everything else)
- RUN mv tmp/dist dist && rm -fr tmp
- EXPOSE 5000
- CMD [ "serve", "--single", "--port", "5000", "dist" ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement