Skip to content

Commit

Permalink
add gunicorn worker with reload option
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurk committed May 20, 2017
1 parent 8b24d49 commit f9ac754
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
- "transport.host=127.0.0.1"
2 changes: 1 addition & 1 deletion optical/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ Sanic
elasticsearch
elasticsearch-dsl
ipython
Jinja2
Jinja2
gunicorn

0 comments on commit f9ac754

Please sign in to comment.