Giter Site home page Giter Site logo

docker-node-app's Introduction

docker-node-app

It is a sample node application that is containerised and deployed using docker.

Build the image

Go to directory that has your Dockerfile and run the following command to build the Docker image. The -t lets you tag your image with a name so it's easier to find while docker images command:

docker build -t <your username>/docker-node-app .

Your image will listed by docker images command:

$ docker images

# Example
REPOSITORY                          TAG           ID            CREATED
node                                10            1934b0b038d1  5 days ago
<your username>/docker-node-app     latest        d64d3505b0d2  1 minute ago

Run the image

Run your image with the following command:

docker run -it -d -p 9000:8080 <your username>/docker-node-app

-d flag runs application in detech mode, that means running the container in the background and -p flag redirects the public port 9000 to the private port 8080 inside the docker container.

if you wish to go inside the container, you can use following command:

# Enter in the container
$ docker exec -it <container id> /bin/bash

To test your app, open http://localhost:9000 inside your browser.

docker-node-app's People

Contributors

mountainfirefly avatar

Watchers

 avatar  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.