npm run serve not working for a Vue.js app in a Docker container

Viewed 138

I'm trying to implement a feature that enables to make changes on the Vue.js app and preview them live (with npm run serve), which is deployed on a Kubernetes cluster. I want to achieve this without needing to rebuild the docker image from the beginning, but with no luck so far...

When adding CMD ["npm", "run", "serve"] in the Dockerfile, after deploying it, the logs of the running pod seem to be stuck at

Info Starting development server

for a few minutes. After it completes, the site can't be loaded...

My Dockerfile for this Vue.js app is this:

FROM node:12 as build-stage
WORKDIR /app
EXPOSE 8080

COPY . /app/

WORKDIR /app
RUN npm install
RUN npx browserslist@latest --update-db
CMD ["npm", "run", "serve"]
0 Answers
Related