我正在尝试使nodemon和docker-compose相互配合,但遇到一个问题:每次运行docker-compose up
时,都会出现以下错误:sh: missing ]
。以下是相关文件:
Dockerfile
FROM node:11.1.0-alpine
MAINTAINER TileHalo
WORKDIR /usr/src/app
RUN npm install -g nodemon
COPY package*.json ./
RUN npm install --save
COPY . .
EXPOSE 3000
CMD [ "nodemon", "./bin/www"]
和docker-compose.yml
version: "2"
services:
web:
build: .
ports:
- "3000:3000"
depends_on:
- postgres
volumes:
- .:/usr/src/app
postgres:
image: "postgres:alpine"
environment:
POSTGRES_PASSWORD: supersalainen
POSTGRES_USER: kipa
编辑:逗号修复后可在纯docker上运行,但不适用于docker-compose