我正在尝试为现有的QuorraJs应用程序设置docker。 (https://quorrajs.org/docs/v1/preface/quickstart.html)但是我在尝试运行docker-compose构建时遇到问题。
我对码头工作者来说还是新手,不知道我做错了什么。
FROM node:latest
MAINTAINER Erkan Demir <erkan.demir@peopleplan.com.au>
#Add everything in the current directory to our image
ADD . /var/www
RUN cd /var/www; \
npm install \
npm install -g quorra-cli \
EXPOSE 3000:3000
CMD["quorra ride"]
version: '2'
services:
web:
container_name: quorra-web
build: .
ports:
- '3000:3000'
volumes:
- .:/var/www
links:
- db
depends_on:
- db
db:
container_name: quorra-db
image: mysql
ports:
- '3000:3000'
volumes:
- /var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: Petbarn_DB
MYSQL_USER: root
MYSQL_PASSWORD: password
答案 0 :(得分:1)
显然你的Dockerfile有些问题,试试按以下方式运行:
FROM node:latest
MAINTAINER Erkan Demir <erkan.demir@peopleplan.com.au>
#Add everything in the current directory to our image
ADD . /var/www
RUN cd /var/www/ && \
npm install && \
npm install -g quorra-cli
EXPOSE 3000
CMD['quorra', 'ride']
答案 1 :(得分:0)
尝试添加&&
并删除Dockerfile中的最后\
:
...
RUN cd /var/www; \
npm install \
&& npm install -g quorra-cli
...