0
我使用的是meanjs主代码中使用的所有Docker文件。没有任何改变。docker-compose不在Docker容器中安装bower组件
我使用命令docker-compose up 在此之前我需要做什么吗?
我想知道,如果我在一个文件中瞬间获取反映在docker容器上,那么为什么不在docker容器上复制或发现bower组件/文件?
继承人包容器内的包的列表。
集装箱的bower.json文件是正确的。
这里的bower.json
{
"name": "meanjs",
"description": "Fullstack JavaScript with MongoDB, Express, AngularJS, and Node.js.",
"homepage": "http://meanjs.org/",
"license": "MIT",
"dependencies": {
"angular": "~1.5.0",
"angular-animate": "~1.5.0",
"angular-bootstrap": "~1.2.1",
"angular-messages": "~1.5.0",
"angular-mocks": "~1.5.0",
"angular-resource": "~1.5.0",
"angular-ui-notification": "~0.2.0",
"angular-ui-router": "~0.2.18",
"bootstrap": "~3.3.6",
"ng-file-upload": "^12.1.0",
"ng-img-crop": "ngImgCrop#^0.3.2",
"owasp-password-strength-test": "~1.3.0",
"underscore": "^1.8.3",
"angular-material": "^1.1.1",
"angular-material-data-table": "^0.10.9",
"material-design-icons": "^3.0.1",
"angular-moment": "^1.0.0",
"angular-aria": "^1.5.8"
},
"overrides": {
"bootstrap": {
"main": [
"dist/css/bootstrap.css",
"dist/css/bootstrap-theme.css",
"less/bootstrap.less"
]
},
"jquery": {
"main": []
}
}
}
DOCKERFILE:https://github.com/meanjs/mean/blob/master/Dockerfile
# Build:
# docker build -t meanjs/mean .
#
# Run:
# docker run -it meanjs/mean
#
# Compose:
# docker-compose up -d
FROM ubuntu:latest
MAINTAINER MEAN.JS
# 80 = HTTP, 443 = HTTPS, 3000 = MEAN.JS server, 35729 = livereload, 8080 = node-inspector
EXPOSE 80 443 3000 35729 8080
# Set development environment as default
ENV NODE_ENV development
# Install Utilities
RUN apt-get update -q \
&& apt-get install -yqq \
curl \
git \
ssh \
gcc \
make \
build-essential \
libkrb5-dev \
sudo \
apt-utils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install nodejs
RUN curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
RUN sudo apt-get install -yq nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install MEAN.JS Prerequisites
RUN npm install --quiet -g gulp bower yo mocha karma-cli pm2 && npm cache clean
RUN mkdir -p /opt/mean.js/public/lib
WORKDIR /opt/mean.js
# Copies the local package.json file to the container
# and utilities docker container cache to not needing to rebuild
# and install node_modules/ everytime we build the docker, but only
# when the local package.json file changes.
# Install npm packages
COPY package.json /opt/mean.js/package.json
RUN npm install --quiet && npm cache clean
# Install bower packages
COPY bower.json /opt/mean.js/bower.json
COPY .bowerrc /opt/mean.js/.bowerrc
RUN bower install --quiet --allow-root --config.interactive=false
COPY . /opt/mean.js
# Run MEAN.JS server
CMD npm install && npm start
泊坞窗,comopse.yml
version: '2'
services:
web:
restart: always
build: .
container_name: meanjs
ports:
- "3000:3000"
- "5858:5858"
- "8080:8080"
- "35729:35729"
environment:
- NODE_ENV=development
- DB_1_PORT_27017_TCP_ADDR=db
depends_on:
- db
volumes_from:
- web-data
web-data:
build: .
entrypoint: /bin/true
volumes:
- ./:/opt/mean.js
- /opt/mean.js/node_modules
- /opt/mean.js/public
- /opt/mean.js/uploads
db:
image: mongo:3.2
restart: always
ports:
- "27017:27017"
volumes_from:
- db-data
db-data:
image: mongo:3.2
volumes:
- /data/db
- /var/lib/mongodb
- /var/log/mongodb
entrypoint: /bin/true
OUTPUT当运行多克尔-COMPOSE
你的docker-compose.yml是什么样的?请在启动时向我们显示docker-compose的输出。 –
我已经提供了上面的输出。让我们不用担心Trailign错误,因为使用gulp命令的同一代码在本地工作,并且主要问题是我不能在容器上安装组件。 –