Skip to content

Commit

Permalink
Use gevent for gunicorn
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Hatt committed Aug 8, 2024
1 parent 9eb8e7d commit 83d7665
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Create and publish a Docker image

on:
pull:
branches: [ "dev" ]
push:
branches: [ "main", "dev" ]
tags:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ ENTRYPOINT ["/app/bin/docker-entrypoint-web"]

EXPOSE 8000

CMD ["gunicorn", "-c", "backend/config/gunicorn.py", "-k", "uvicorn.workers.UvicornWorker", "backend.app:create_app()"]
CMD ["gunicorn", "-c", "backend/config/gunicorn.py", "-k", "gevent", "backend.main:app"]
3 changes: 2 additions & 1 deletion backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def middleware(app: flask.Flask):
app.wsgi_app = DebuggedApplication(app.wsgi_app, evalex=True)

# Set the real IP address into request.remote_addr when behind a proxy.
app.wsgi_app = ProxyFix(app.wsgi_app)
# app.wsgi_app = ProxyFix(app.wsgi_app)

# CORS configuration
origins = ["http://localhost:5173"]
Expand All @@ -104,3 +104,4 @@ def middleware(app: flask.Flask):
)

return None

4 changes: 4 additions & 0 deletions backend/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from backend.app import create_app


app = create_app()

0 comments on commit 83d7665

Please sign in to comment.