Coder Social home page Coder Social logo

opemipovrb / twisted-docker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jcfausto/twisted-docker

0.0 1.0 0.0 7 KB

A basic example to deploy a Twisted application as a Docker container

License: MIT License

Dockerfile 28.69% Python 71.31%

twisted-docker's Introduction

twisted-docker

A basic example to deploy a Twisted application as a Docker container

Requirements

  • Python 2.7
  • Docker 1.9.1 or superior
  • Docker Compose 1.0.6rc2 or superior

Dockerfile

The Dockerfile install all necessary requirements to properly run twisted in a *nix environment.

Server Config

Port

Just set an environment variable called ECHO_SERVER_PORT and define a value.

By default, the server will run at the 8000 port.

OBS: If you use Vagrant or other VM environment, assure that the portforwarding is properly configured in order to access the server from the host machine.

Running on Docker

git clone https://github.com/jcfausto/twisted-docker.git
export ECHO_SERVER_PORT=5000
cd twisted-docker/server
docker-compose up -d (it will take some time in the firsr run)

After the image, the container will be started. Check with:

docker ps

When the container starts, just access:

http://192.168.99.100:5000 and you should see the responder from the echo server.

  • Your docker IP may vary.

Running locally

You also can run the app locally. Follow this steps:

git clone https://github.com/jcfausto/twisted-docker.git
cd twisted-docker
mkvirtualenv twisted-docker #using virtualenvwrapper here.
cd server
pip install -r requirements.txt
export ECHO_SERVER_PORT=5000
twistd --nodaemon --python=run_server.py

Access: http://localhost:5000 and you should see the responder from the echo server.

twisted-docker's People

Contributors

jcfausto avatar

Watchers

James Cloos 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.