0

我有一个 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

码头工人-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
4

1 回答 1

0

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

于 2015-09-08T04:19:59.527 回答