i have some scenario that i cant solve. angular 5 application development. docker file that copies the package.json and during the build npm installs the node_modules. and i want those node_modules to be visible on host so developer can work comfortably on /src folder. application works from container but when coding i cant use autocomplete because modules are not available.
FROM node:10 as node
# FROM node:alpine as node
RUN mkdir -p /app
WORKDIR /app
COPY . /app/
RUN npm install -g @angular/cli@~6.0.3
# RUN yarn --pure-lockfile
# RUN yarn install --no-cache --frozen-lockfile --no-bin-links
RUN npm install
EXPOSE 4200
CMD ng serve --host 0.0.0.0 --disable-host-check --watch --poll 1000
docker-compose.yaml
version: '3'
services:
frontend-service:
build: ./frontend
volumes:
- ./frontend:/app
- /app/node_modules
ports:
- 4200:4200