From 443eada9669773a8bed655b13a02627c7ea7fe54 Mon Sep 17 00:00:00 2001 From: Cory Lee Date: Wed, 12 Feb 2020 16:33:56 -0500 Subject: [PATCH 1/3] Adding --- Dockerfile | 27 +++++++++++++++++++++++++++ docker_gunicorn_config.py | 5 +++++ 2 files changed, 32 insertions(+) create mode 100644 Dockerfile create mode 100644 docker_gunicorn_config.py diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..54706ac --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM ubuntu:xenial as openedx + +RUN apt update && \ + apt install -y git-core language-pack-en apparmor apparmor-utils python python-pip python-dev build-essential gcc gfortran liblapack-dev libxml++2.6-dev libxml2-dev libxml2-utils libxslt1-dev python-dev apparmor-utils -qy && \ + pip install --upgrade pip setuptools && \ + rm -rf /var/lib/apt/lists/* + +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 + +WORKDIR /edx/app/xserver +COPY requirements /edx/app/xserver/requirements +RUN pip install -r requirements/base.txt + +EXPOSE 8150 + +USER app +RUN useradd -m --shell /bin/false app +CMD gunicorn -c /edx/app/docker_gunicorn_config.py pyxserver_wsgi:application + +COPY . /edx/app/xserver + +FROM openedx as edx.org +RUN pip install newrelic +CMD newrelic-admin run-program gunicorn -c /edx/app/docker_gunicorn_config.py pyxserver_wsgi:application diff --git a/docker_gunicorn_config.py b/docker_gunicorn_config.py new file mode 100644 index 0000000..cd3a55d --- /dev/null +++ b/docker_gunicorn_config.py @@ -0,0 +1,5 @@ +preload_app = True +timeout = 30 +bind = "localhost:8050" +workers = 6 + From 6526beaeffe69fa22a5b4e5077114ebf372eb7ec Mon Sep 17 00:00:00 2001 From: Cory Lee Date: Wed, 12 Feb 2020 16:50:11 -0500 Subject: [PATCH 2/3] Iterating... --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 54706ac..e06574b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,14 +14,14 @@ WORKDIR /edx/app/xserver COPY requirements /edx/app/xserver/requirements RUN pip install -r requirements/base.txt -EXPOSE 8150 +EXPOSE 8050 USER app RUN useradd -m --shell /bin/false app -CMD gunicorn -c /edx/app/docker_gunicorn_config.py pyxserver_wsgi:application +CMD gunicorn -c /edx/app/docker_gunicorn_config.py --bind=0.0.0.0:8000 --workers 2 --max-requests=1000 pyxserver_wsgi:application COPY . /edx/app/xserver FROM openedx as edx.org RUN pip install newrelic -CMD newrelic-admin run-program gunicorn -c /edx/app/docker_gunicorn_config.py pyxserver_wsgi:application +CMD newrelic-admin run-program gunicorn -c /edx/app/docker_gunicorn_config.py --bind=0.0.0.0:8000 --workers 2 --max-requests=1000 pyxserver_wsgi:application From 3251088010148c87c58da8592d7122754e85b797 Mon Sep 17 00:00:00 2001 From: Cory Lee Date: Wed, 12 Feb 2020 16:57:19 -0500 Subject: [PATCH 3/3] Update Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e06574b..fc45031 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,10 +18,10 @@ EXPOSE 8050 USER app RUN useradd -m --shell /bin/false app -CMD gunicorn -c /edx/app/docker_gunicorn_config.py --bind=0.0.0.0:8000 --workers 2 --max-requests=1000 pyxserver_wsgi:application +CMD gunicorn -c /edx/app/docker_gunicorn_config.py --bind=0.0.0.0:8050 --workers 2 --max-requests=1000 pyxserver_wsgi:application COPY . /edx/app/xserver FROM openedx as edx.org RUN pip install newrelic -CMD newrelic-admin run-program gunicorn -c /edx/app/docker_gunicorn_config.py --bind=0.0.0.0:8000 --workers 2 --max-requests=1000 pyxserver_wsgi:application +CMD newrelic-admin run-program gunicorn -c /edx/app/docker_gunicorn_config.py --bind=0.0.0.0:8050 --workers 2 --max-requests=1000 pyxserver_wsgi:application