Dockerfile 698 B

123456789101112131415161718192021222324252627282930
  1. # Create image based on the official Node image from dockerhub
  2. FROM node:13.13.0-stretch
  3. #Argument that is passed from docer-compose.yaml file
  4. ARG FRONT_END_PORT
  5. # Create app directory
  6. WORKDIR /usr/src/app
  7. #Echo the argument to check passed argument loaded here correctly
  8. RUN echo "Argument port is : $FRONT_END_PORT"
  9. # Copy dependency definitions
  10. COPY package.json /usr/src/app
  11. COPY package-lock.json /usr/src/app
  12. # Install dependecies
  13. #RUN npm set progress=false \
  14. # && npm config set depth 0 \
  15. # && npm i install
  16. RUN npm ci
  17. # Get all the code needed to run the app
  18. COPY . /usr/src/app
  19. # Expose the port the app runs in
  20. EXPOSE ${FRONT_END_PORT}
  21. # Serve the app
  22. CMD ["npm", "start"]