Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.3k views
in Technique[技术] by (71.8m points)

vue.js - Docker Compose MEVN not reflecting updates made to package.json

I am trying to deploy my MEVN app using Docker, but I can't seem to make Docker update when I change my package.json

I'm running docker-compose up -d and have shut it down using docker-compose down to try to reset the project. I've changed the version on my package.json file to verify, and logging says its running @0.1.0 when it should reflect a change to 0.2.0 so I know for sure its not running the updated changes. I have also used the --force-recreate flag, which still did not show the new changes either.

docker ps -a shows that the containers are no longer on my machine as well.

npm logs an error no longer relevant as it reflects an issue with version 0.1.0 of the file that I have since corrected. All help is appreciated!

npm output

bell-magazine@0.1.0 start /usr/src/app, should read bell-magazine@0.2.0 ...

docker-compose.yml

version: "3"
services:
  client:
    command: npm run start
    container_name: bell-magazine
    build: ./client
    ports: ["8089:8089"]
    environment:
      - NODE_ENV=development
  server:
    command: npm run start
    container_name: bell-magazine-api
    build: ./server
    ports: ["5000:5000"]
    environment:
      - NODE_ENV=development

Dockerfile

FROM node:11

WORKDIR /usr/src/app
COPY package*.json ./

RUN npm install

EXPOSE 8089

COPY . .

snippets from package.json

  "name": "bell-magazine",
  "version": "0.2.0",
  "private": true,
  "scripts": {
    "start": "vue-cli-service serve",
     ...
  },

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...