GithubHelp home page GithubHelp logo

ngodson / docker_compose Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 19 KB

This is a simple containerized app using mongo, java script. It simply shows the steps to build and use a several apps together as a single container.

Dockerfile 10.39% HTML 37.43% JavaScript 52.18%

docker_compose's Introduction

demo app - for docker-compose crash course

With Docker

To start the application

Step 1: Create docker network

docker network create mongo-network 

Step 2: start mongodb

docker run -d -p 27017:27017 -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=password --name mongodb --net mongo-network mongo    

Step 3: start mongo-express

docker run -d -p 8081:8081 -e ME_CONFIG_MONGODB_ADMINUSERNAME=admin -e ME_CONFIG_MONGODB_ADMINPASSWORD=password --net mongo-network --name mongo-express -e ME_CONFIG_MONGODB_SERVER=mongodb mongo-express   

NOTE: creating docker-network in optional. You can start both containers in a default network. In this case, just emit --net flag in docker run command

With Docker Compose

To start the application

Step 1: start mongodb and mongo-express

docker-compose -f docker-compose.yaml up

You can access the mongo-express under localhost:8080 from your browser

Step 2: open mongo-express from browser

http://localhost:8081

Step 3: create my-db db and my-collection collection and document with {myid: 1, data: "some dynamic data loaded from db"} in mongo-express

Step 4: Access you nodejs application UI from browser

http://localhost:3000

docker_compose's People

Contributors

ngodson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.