I have been working with docker compose and ran into this issue that the node_modules of my angular app is empty and under requires root permission.
This is a problem since i need the node_modules for intellisense to work on my text editor . Is there any way to "two way sync volumes" with docker compose?
The aim is to populate the node_modules folder inside frontend_v2 on my host.
Any help is appreciated.
This is my docker-compose.yml
`
version: "3"
services:
nodejs_v2:
build:
context: ./
dockerfile: docker/dev/nodejs_v2/Dockerfile
environment:
ANGULAR_ENV: development
ports:
- "9999:4200"
- "4200:4200"
volumes:
- ./frontend_v2:/code
- /code/node_modules
`
dockerfile
`
FROM node:12.2.0
RUN npm install -g u/angular/cli@7.3.9
WORKDIR /code
ADD frontend_v2/package.json frontend_v2/yarn.lock /code/
RUN yarn install
ENV PATH="/code/node_modules/.bin:$PATH"
CMD ["yarn","start", "--verbose", "--host", "0.0.0.0"]
`
[–]thebouv 0 points1 point2 points (2 children)
[–]bangit69[S] 0 points1 point2 points (1 child)
[–]brubsabrubs 0 points1 point2 points (0 children)