I want to build a vue 2 app with docker, but got sh: vue-cli-service: not found
error.
For serve, I have another docker files and everything there is fine, but in build I got this error!
Dockerfile
# build stage
FROM node:14.18.0-alpine as build-stage
ENV NODE_ENV=production
WORKDIR /var/www/html/app
COPY package*.json ./
RUN npm install -g @vue/cli
RUN npm i
COPY . .
RUN npm run build
# production stage
FROM nginx:stable-alpine as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
docker-compose.yml
version: '3.7'
services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:80"
command: docker-compose up -d