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
~$ 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 directoryrmukhia/im-meanjs
image namebash
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
.
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.
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.
From any browser of the host, view the MEAN.JS application
Edit files of the MEAN.JS application from the host directory which you have mounted to the container using your favourite editor or IDE.
After starting a new container start mongod, change the present working directory to the application directory and start grunt.
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