diff --git a/docker-compose.yml b/docker-compose.yml index 5d7c060..c9cfc3b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,10 +6,11 @@ services: - "8080:8080" volumes: - .:/code + command: gunicorn --reload --chdir /code/optical --bind localhost:8000 --worker-class sanic.worker.GunicornWorker app elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:5.4.0 ports: - 9200:9200 environment: - "http.host=0.0.0.0" - - "transport.host=127.0.0.1" \ No newline at end of file + - "transport.host=127.0.0.1" diff --git a/optical/app.py b/optical/app.py index d1867e8..3156038 100644 --- a/optical/app.py +++ b/optical/app.py @@ -7,7 +7,7 @@ client = Elasticsearch(hosts=['elasticsearch'], http_auth=('elastic', 'changeme',)) env = Environment(loader=PackageLoader('app', 'templates')) -app = Sanic(__name__) +app = application = Sanic(__name__) @app.route('/') async def test(request): diff --git a/requirements.txt b/requirements.txt index dcc279e..ff1279d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,5 @@ Sanic elasticsearch elasticsearch-dsl ipython -Jinja2 \ No newline at end of file +Jinja2 +gunicorn