0

I'm using all the Docker files used in the master code of meanjs. Nothing changed at all.

I use the command

docker-compose up

Do I need to do anything before this ?

I wonder since the change if I make in one file instantaneously gets reflected on the docker container, then why dont the bower_components files aren't replicated or found on the docker container ?

Here's the list of packages fond inside the container.

image

on Container the bower.json file is correct.

image

Here's 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 taken from here: 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

docker-compose.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 when running docker-compose up command:

docker-compose up

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

2
  • 1
    what does your docker-compose.yml look like? and please show us the output from docker-compose when you start it. Nov 12, 2016 at 21:28
  • i've provided the output above. Lets not worry about the Trailign errors cos the same code is working on the local using the gulp command and the main issue i sbower isn't installing the components on the container.
    – JP.
    Nov 12, 2016 at 21:41

1 Answer 1

1

For some reason it wasn't updating the contents, so I removed all the docker containers and images too. Now it works.

1
  • I haven't really read this post to be honest but executing docker-compose up --build is what actually executes the copying from source folder to container, instead of just restarting the container without copying the potentially new files
    – lenny
    May 24, 2019 at 9:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.