Skip to content

rmukhia/im-meanjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

im-meanjs

This is a docker image of MEAN.JS, hence the name im-meanjs. The main goal of this image is to provide an easy way to try out developing MEAN.JS applications.

Have fun using I am MEAN.JS.

Visit dockerhub repository rmukhia/im-meanjs. Visit github repository rmukhia/im-meanjs

Run
~$ docker pull rmukhia/im-meanjs

Pull im-meanjs from dockerhub.

~$ docker run -i -t -p 3000:3000 -p 35729:35729 -v $('pwd'):/home/dev/projects rmukhia/im-meanjs bash

Create a docker container.

  • -i interactive
  • -t attach to terminal
  • -p 3000:3000 map the host port 3000 to the container 3000 port
  • -p 35729:35729 map the host port 35729 to the container's 35729 port; this is required for livereload.js
  • -v $('pwd'):/home/dev/projects mount the host's present working directory to container's /home/dev/projects directory
  • rmukhia/im-meanjs image name
  • bash open an interactive shell

If you want to make mongodb database persistent, host db directory should be mounted to container's /data/db directory by adding an option -v ~/db:/data/db.

Start mongod

Inside the container;

~$ mongod --config ~/config/mongod.conf

Start mongod server

~$ cat ~/logs/mongod.log

Check if mongod is running an a deamon.

~/config/mongod.conf is a mongod configuration file, which can be edited.

Create a new MEAN.JS application.

Inside the container;

$ cd projects

Change the present working directory to mounted /home/dev/projects.

projects$ mkdir myapp && cd myapp

Create a new MEAN.JS application directory and change the present working directory.

projects$ yo meanjs

Use yomean to generate a MEAN.JS application. Create a new project myapp in myapp folder. This will take some time.

myapp$ grunt

Start MEAN.JS application.

View and Edit

From any browser of the host, view the MEAN.JS application

http://localhost:3000

Edit files of the MEAN.JS application from the host directory which you have mounted to the container using your favourite editor or IDE.

Reopen MEAN.JS application

After starting a new container start mongod, change the present working directory to the application directory and start grunt.

Features

im-meanjs is debian based and has the following features:

  • Node.js and mongodb-org-server pre-installed,
  • yo, grunt and generator-meanjs@0.1.12 pre-installed,
  • non root dev user pre-created, login in as dev,
  • global npm packages installed under /home/dev/.npm_global,
  • configurable ~/config/mongod.conf,
  • mount projects from host in /home/dev/projects,
  • turn on, turn off presistent database by optionally mounting the container's /data/db directory

About

Dockerfile for rmukhia/meanjs image.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published