简体   繁体   English

如何通过dockerize流星新鲜应用程序?

[英]How to dockerize a meteor fresh application?

I am trying to dockerize a meteor application (v1.6.1) by building a docker image using Dockerfile and creating and running a container using docker-compose.yml but all my trials failed. 我试图通过使用Dockerfile构建Dockerfile并使用Dockerfile docker-compose.yml创建并运行容器来对流星应用程序(v1.6.1)进行Dockerfile ,但是我所有的尝试均失败了。

I have used this command to build a docker meteor image 我已经使用此命令来构建docker流星图像

docker build -t badis/meteor .

I have a good experience using meteor and little using docker. 我在使用流星方面有很好的经验,而很少使用docker。

Here my Dockerfile 这是我的Dockerfile

FROM node:carbon

# Create app directory
WORKDIR /usr/src/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

RUN curl https://install.meteor.com/?release=1.6.1 | sh
RUN npm install
# If you are building your code for production
# RUN npm install --only=production

# Bundle app source
COPY . .

EXPOSE 8080
CMD [ "npm", "start" ]

Here my .dockerignore 这是我的.dockerignore

node_modules
npm-debug.log

Here my docker-compose.yml 这是我docker-compose.yml

dashboard:
  image: badis/meteor
  ports:
   - "81:80"
  links:
   - mongo
  environment:
   - MONGO_URL=mongodb://mongo/boiler
   - ROOT_URL=http://localhost


mongo:
  image: mongo:3.2

The error is quite self-explanatory. 该错误是不言自明的。 You need to pass --allow-superuser when running the meteor build command. 运行流星构建命令时,需要传递--allow-superuser

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM