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.
~$ 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.
-tattach to terminal
-p 3000:3000map the host port 3000 to the container 3000 port
-p 35729:35729map the host port 35729 to the container's 35729 port; this is required for livereload.js
-v $('pwd'):/home/dev/projectsmount the host's present working directory to container's /home/dev/projects directory
bashopen 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
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.
Start MEAN.JS application.
View and Edit
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.
Reopen MEAN.JS application
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 email@example.com 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