A
A
Anton V.2020-05-26 19:21:13
Docker
Anton V., 2020-05-26 19:21:13

How to make the generated files saved when docker bind?

Good afternoon!

During the initialization build, npm installs the dependencies.
I go into the container, node_modules is in place.
but CMD ["quasar", "dev"] says dev not found...

When I go to the working directory on the local machine, node_modules is missing.

How can I make the node_modules folder stay in the working folder of the project?

With layers, you can see that I didn’t understand everything ...

docker-compose.yml

.....
  quasar:
    container_name: quasar
    build:
      context: .
      dockerfile: quasar/Dockerfile
    restart: on-failure    
    ports:
      - "127.0.0.2:8181:8181" 
    volumes:
      - ./src:/var/www:
    networks:
      - app-network
...


Dockerfile
FROM node:10-alpine

RUN apk add --update --no-cache bash \
  && apk add --update --no-cache -t .build-deps python make g++ gcc \
  && npm i -g @quasar/cli \
  && apk del .build-deps

WORKDIR /var/www/quasar


RUN npm install

CMD ["quasar", "dev"]

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question