diff --git a/README.rst b/README.rst index f694c6d..5dddc31 100644 --- a/README.rst +++ b/README.rst @@ -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 ------------- diff --git a/demoapp/Dockerfile b/demoapp/Dockerfile new file mode 100644 index 0000000..088cf2b --- /dev/null +++ b/demoapp/Dockerfile @@ -0,0 +1,5 @@ +FROM python:alpine +COPY ./ /demoapp/ +EXPOSE 7272 +RUN chmod +x /demoapp/server.py +ENTRYPOINT [ "/demoapp/server.py" ] diff --git a/demoapp/server.py b/demoapp/server.py index a961366..b619c9e 100755 --- a/demoapp/server.py +++ b/demoapp/server.py @@ -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): diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..4a4ad12 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,8 @@ +version: '2' +services: + webdemo: + build: + context: ./demoapp + dockerfile: Dockerfile + ports: + - '7272:7272' \ No newline at end of file