Application demo designed to show how Node.js and MongoDB can be run in Docker containers. The app uses Mongoose to create a simple database that stores Docker commands and examples.
##To run the app with Docker Containers:
- Install Docker Toolbox (http://docker.com/toolbox).
- open a terminal
-
Open the
Docker QuickStart Terminal
. After VirtualBox starts in the terminal navigate to the app's folder. -
Run the commands listed in
node.dockerfile
(see the comments at the top of the file) in theDocker QuickStart Terminal
. -
Navigate to http://192.168.99.100:8080 in your browser to view the site. This assumes that's the IP assigned to VirtualBox - change if needed.
##To run the app with Node.js and MongoDB (without Docker):
-
Install and start MongoDB (https://docs.mongodb.org/manual/installation).
-
Install Node.js (http://nodejs.org).
-
Open
config/config.development.json
and adjust the host name to your MongoDB server name (localhost
normally works if you're running locally). -
Run
npm install
. -
Run
node dbSeeder.js
to get the sample data loaded into MongoDB. Exit the command prompt. -
Run
node server.js
to start the server. -
Navigate to http://localhost:8080 in your browser.
##config settings ##if running mongo as a docker containe and node as standalone host": "192.168.99.100:27017", ##running linked mongo container to node container "host": "mongodb",
"# cursoDocker" "# cursoDocker"