Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demoapp listening address more wider, required to dockerized solution. #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ If the application was started by double-clicking ``demoapp/server.py``
file, it can be shut down by closing the opened window. If it was
executed from the command line, using ``Ctrl-C`` is enough.

OR with docker-compose:
Start to backround: `docker-compose up -d`
Stop: `docker-compose down`


Running tests
-------------

Expand Down
5 changes: 5 additions & 0 deletions demoapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM python:alpine
COPY ./ /demoapp/
EXPOSE 7272
RUN chmod +x /demoapp/server.py
ENTRYPOINT [ "/demoapp/server.py" ]
2 changes: 1 addition & 1 deletion demoapp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class DemoServer(ThreadingMixIn, HTTPServer):
allow_reuse_address = True

def __init__(self, port=PORT):
HTTPServer.__init__(self, ('localhost', int(port)),
HTTPServer.__init__(self, ('0.0.0.0', int(port)),
SimpleHTTPRequestHandler)

def serve(self, directory=ROOT):
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '2'
services:
webdemo:
build:
context: ./demoapp
dockerfile: Dockerfile
ports:
- '7272:7272'