While running docker-compose with vue.js application, It keeps throwing error as following
- web_1 | sh: vue-cli-service: not found
- server_1 | > tslint -c tslint.json -p tsconfig.json --fix
It is found that While running the docker-compose the path to the vue-cli-service/tslint is not found.
Solution:
- Install the vue cli as global in Dockerfile as follows.
- Include the path to the bat/exe to the docker environment path as follows.
Sample Dockerfile:
FROM node:12.2.0-alpine
WORKDIR /app
COPY . /app
ENV PATH /app/node_modules/.bin:$PATH
RUN npm install -g typescript
RUN npm install -g tslint
RUN npm install
CMD ["npm", "run","start"]