【问题标题】:Nodemon doesn't restartNodemon 不重启
【发布时间】:2015-12-03 02:20:14
【问题描述】:

我有一个 nodemon 在 docker-container 中运行,并在 OSX 上安装了卷。 Nodemon 正在接收文件更改,但它没有重新启动服务器。

输出:

Creating piclet_web_1...
Attaching to piclet_web_1
web_1 | 7 Sep 13:37:19 - [nodemon] v1.4.1
web_1 | 7 Sep 13:37:19 - [nodemon] to restart at any time, enter `rs`
web_1 | 7 Sep 13:37:19 - [nodemon] watching: *.*
web_1 | 7 Sep 13:37:19 - [nodemon] starting node ./index.js
web_1 | restify listening at http://[::]:80 //normal output of started node-app
//file-change, which gets detected
web_1 | 7 Sep 13:37:30 - [nodemon] restarting due to changes...
//no output of restarted server

Dockerfile:

FROM node:0.12.7-wheezy
EXPOSE 80

RUN npm install nodemon -g

ADD app /app
WORKDIR app

RUN npm install

docker-compose.yml

web:
  build: .
  ports:
    - "80:80"
  volumes:
    - ./app/lib:/app/lib
  links:
    - db
  command: "nodemon -L ./index.js"
db:
  image: mongo:3.1.7

【问题讨论】:

  • 您能否提供一些上下文,例如应用程序的Dockerfiledocker-compose.yml,以便人们可以测试问题?我相信你也读过github.com/remy/nodemon/issues/419?
  • 我编辑了这个问题。我确实读过这个问题,但它指的是没有检测到更改的问题,我的问题是检测到更改,但是节点应用程序没有重新启动(控制台和旧版本上没有启动输出仍然可用)。

标签: node.js docker nodemon docker-machine


【解决方案1】:

我通过为容器选择另一个基础映像解决了这个问题:node:0.12.7 而不是 node:0.12.7-wheezy

【讨论】:

    猜你喜欢
    • 2017-12-04
    • 2020-07-16
    • 2019-03-23
    • 2020-07-11
    • 2017-01-07
    • 2019-06-22
    • 2019-09-12
    • 1970-01-01
    相关资源
    最近更新 更多