Use Gunicorn

This commit is contained in:
Kenneth Allen 2023-06-26 16:47:33 +10:00
parent 1da0f08bc2
commit eea4f60e5a
5 changed files with 20 additions and 3 deletions

View File

@ -11,4 +11,4 @@ RUN poetry install --no-dev
COPY ./ ./ COPY ./ ./
CMD ["flask", "run", "--host", "0.0.0.0"] CMD ["gunicorn", "--bind", "0.0.0.0"]

View File

@ -3,4 +3,4 @@ services:
build: . build: .
init: true init: true
ports: ports:
- "127.0.0.1:5123:5000" - "127.0.0.1:5123:8000"

1
gunicorn.conf.py Normal file
View File

@ -0,0 +1 @@
wsgi_app = 'app:app'

17
poetry.lock generated
View File

@ -44,6 +44,20 @@ Werkzeug = ">=2.3.3"
async = ["asgiref (>=3.2)"] async = ["asgiref (>=3.2)"]
dotenv = ["python-dotenv"] dotenv = ["python-dotenv"]
[[package]]
name = "gunicorn"
version = "20.1.0"
description = "WSGI HTTP Server for UNIX"
category = "main"
optional = false
python-versions = ">=3.5"
[package.extras]
eventlet = ["eventlet (>=0.24.1)"]
gevent = ["gevent (>=1.4.0)"]
setproctitle = ["setproctitle"]
tornado = ["tornado (>=0.2)"]
[[package]] [[package]]
name = "itsdangerous" name = "itsdangerous"
version = "2.1.2" version = "2.1.2"
@ -91,13 +105,14 @@ watchdog = ["watchdog (>=2.3)"]
[metadata] [metadata]
lock-version = "1.1" lock-version = "1.1"
python-versions = "^3.10" python-versions = "^3.10"
content-hash = "d7a65ba75d9fd1d70398a76955d93d28129b8c09a3b56e10fef71ce427090c8b" content-hash = "4ec3e1cccd00033533e7cccad14be71112cf16ba8c1694db899d9a321267d818"
[metadata.files] [metadata.files]
blinker = [] blinker = []
click = [] click = []
colorama = [] colorama = []
flask = [] flask = []
gunicorn = []
itsdangerous = [] itsdangerous = []
jinja2 = [] jinja2 = []
markupsafe = [] markupsafe = []

View File

@ -7,6 +7,7 @@ authors = ["Kenneth Allen <kenneth@kallen.dev>"]
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = "^3.10" python = "^3.10"
Flask = "^2.3.2" Flask = "^2.3.2"
gunicorn = "^20.1.0"
[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]