Install node_modules inside Docker container and synchronize them with host
Install node_modules inside Docker container and synchronize them with host I have the problem with installing node_modules inside the Docker container and synchronize them with the host. My Docker's version is 18.03.1-ce, build 9ee9f40 and Docker Compose's version is 1.21.2, build a133471 . node_modules 18.03.1-ce, build 9ee9f40 1.21.2, build a133471 My docker-compsose.yml looks like: docker-compsose.yml # Frontend Container. frontend: build: ./app/frontend volumes: - ./app/frontend:/usr/src/app - frontend-node-modules:/usr/src/app/node_modules ports: - 3000:3000 environment: NODE_ENV: ${ENV} command: npm start # Define all the external volumes. volumes: frontend-node-modules: ~ My Dockerfile : Dockerfile # Set the base image. FROM node:10 # Create and define the working directory. RUN mkdir /usr/src/app WORKDIR /usr/src/app # Install the application's dependencies. COPY package.json ./ COPY package-lock.json ./ RUN npm install The trick with...
