Skip to content

Commit

Permalink
Use ASGI by default
Browse files Browse the repository at this point in the history
  • Loading branch information
patrys committed Aug 6, 2020
1 parent f1b8a01 commit b3d724f
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 23 deletions.
20 changes: 9 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ RUN groupadd -r saleor && useradd -r -g saleor saleor

RUN apt-get update \
&& apt-get install -y \
libxml2 \
libssl1.1 \
libcairo2 \
libpango-1.0-0 \
libpangocairo-1.0-0 \
libgdk-pixbuf2.0-0 \
shared-mime-info \
mime-support \
libxml2 \
libssl1.1 \
libcairo2 \
libpango-1.0-0 \
libpangocairo-1.0-0 \
libgdk-pixbuf2.0-0 \
shared-mime-info \
mime-support \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand All @@ -43,8 +43,6 @@ ENV STATIC_URL ${STATIC_URL:-/static/}
RUN SECRET_KEY=dummy STATIC_URL=${STATIC_URL} python3 manage.py collectstatic --no-input

EXPOSE 8000
ENV PORT 8000
ENV PYTHONUNBUFFERED 1
ENV PROCESSES 4

CMD ["uwsgi", "--ini", "/app/saleor/wsgi/uwsgi.ini"]
CMD ["gunicorn", "--bind", ":8000", "--workers", "4", "--worker-class", "uvicorn.workers.UvicornWorker", "saleor.asgi:application"]
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
release: python manage.py migrate --no-input
web: uwsgi saleor/wsgi/uwsgi.ini
web: gunicorn --bind :$PORT --workers 4 --worker-class uvicorn.workers.UvicornWorker saleor.asgi:application
celeryworker: celery worker -A saleor.celeryconf:app --loglevel=info -E
137 changes: 129 additions & 8 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ sentry-sdk = "^0"
stripe = "^2.47.0"
text-unidecode = "^1.2"
tqdm = "^4.47"
uwsgi = {version = "^2.0.19", platform = "!=win32"}
weasyprint = ">=48"
oauthlib = "^3.0"
jaeger-client = "^4.3.0"
Expand All @@ -67,6 +66,8 @@ python-json-logger = "^0.1.11"
pytimeparse = "^1.1.8"
django-redis = "^4.12.1"
Adyen = "^3.0.0"
uvicorn = "^0.11.8"
gunicorn = "^20.0.4"

[tool.poetry.dev-dependencies]
black = "19.10b0"
Expand Down
8 changes: 7 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ celery==4.4.7
certifi==2020.6.20
cffi==1.14.0
chardet==3.0.4
click==7.1.2
cssselect2==0.3.0
defusedxml==0.6.0
dj-database-url==0.5.0
Expand Down Expand Up @@ -56,8 +57,11 @@ graphene-django==2.12.1
graphene-federation==0.1.0
graphql-core==2.3.2
graphql-relay==2.0.1
gunicorn==20.0.4
h11==0.9.0
html-to-draftjs==1.0.1
html5lib==1.1
httptools==0.1.1; sys_platform != "win32" and sys_platform != "cygwin" and platform_python_implementation != "PyPy"
idna==2.10
jaeger-client==4.3.0
jdcal==1.4.1
Expand Down Expand Up @@ -114,7 +118,9 @@ tqdm==4.48.1
typing==3.7.4.3
unidecode==1.1.1
urllib3==1.25.9
uwsgi==2.0.19.1; sys_platform != "win32"
uvicorn==0.11.8
uvloop==0.14.0; sys_platform != "win32" and sys_platform != "cygwin" and platform_python_implementation != "PyPy"
vine==1.3.0
weasyprint==51
webencodings==0.5.1
websockets==8.1
7 changes: 6 additions & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,11 @@ graphene-django==2.12.1
graphene-federation==0.1.0
graphql-core==2.3.2
graphql-relay==2.0.1
gunicorn==20.0.4
h11==0.9.0
html-to-draftjs==1.0.1
html5lib==1.1
httptools==0.1.1; sys_platform != "win32" and sys_platform != "cygwin" and platform_python_implementation != "PyPy"
identify==1.4.23
idna==2.10
iniconfig==1.0.1
Expand Down Expand Up @@ -181,11 +184,13 @@ typing==3.7.4.3
typing-extensions==3.7.4.2
unidecode==1.1.1
urllib3==1.25.9
uwsgi==2.0.19.1; sys_platform != "win32"
uvicorn==0.11.8
uvloop==0.14.0; sys_platform != "win32" and sys_platform != "cygwin" and platform_python_implementation != "PyPy"
vcrpy==4.0.2
vine==1.3.0
virtualenv==20.0.27
weasyprint==51
webencodings==0.5.1
websockets==8.1
wrapt==1.12.1
yarl==1.4.2; python_version >= "3.6"

0 comments on commit b3d724f

Please sign in to comment.