Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. # install static server
  2. RUN npm install -g serve
  3.  
  4. # create a 'tmp' folder for the build and make it the current working directory
  5. WORKDIR /app/tmp
  6.  
  7. # copy only the package.json to take advantage of cached Docker layers
  8. COPY package.json .
  9.  
  10. # install project dependencies
  11. RUN npm install
  12.  
  13. # copy project files and folders to the working directory
  14. COPY . .
  15.  
  16. # build for production with minification
  17. RUN npm run build
  18.  
  19. # make the 'app' folder the current working directory
  20. WORKDIR /app
  21.  
  22. # clean up (i.e. extract 'dist' folder and remove everything else)
  23. RUN mv tmp/dist dist && rm -fr tmp
  24.  
  25. EXPOSE 5000
  26. CMD [ "serve", "--single", "--port", "5000", "dist" ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement