GithubHelp home page GithubHelp logo

boobalan1 / hit-counter-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from smakam/hit-counter-demo

0.0 2.0 0.0 11 KB

A basic Python web app to demonstrate linking docker containers

Python 100.00%

hit-counter-demo's Introduction

hit_counter

A basic Python web app to demonstrate linking docker containers

How to use

Clone this repository for use with:

$ git clone https://github.com/smakam/hit_counter

Build a docker image for python web application:

$ docker build -t smakam/web .

Run a redis container, the container will export port 6379:

$ docker run --name redis -d redis

Run python web application and link it with redis container:

$ docker run --name web --link redis:redis \
  -p 5000:5000 -d smakam/web python app.py

The web app should now be listening on port 5000 on your docker daemon, we can visit it:

# Inside Docker Host
$ curl localhost:5000
Hello World! I have been seen 1 times.
$ curl localhost:5000
Hello World! I have been seen 2 times.

# Outside Docker host
$ curl <docker host>:5000
Hello World! I have been seen 3 times.

hit-counter-demo's People

Contributors

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