From 7001d68ba791f7bb31ae8c9ca9ed7feb086da40c Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Mon, 28 Oct 2024 18:39:16 +0500 Subject: [PATCH] fix: corrected requirements dir path for enterprise_access(#45) * fix: corrected requirements dir path for enterprise_access --- dockerfiles/enterprise-access.Dockerfile | 28 +++++++++++++----------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/dockerfiles/enterprise-access.Dockerfile b/dockerfiles/enterprise-access.Dockerfile index 75bb515..f984abb 100644 --- a/dockerfiles/enterprise-access.Dockerfile +++ b/dockerfiles/enterprise-access.Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:focal as app +FROM ubuntu:focal AS app MAINTAINER sre@edx.org @@ -81,10 +81,10 @@ RUN ./configure && make && make install && ldconfig RUN ln -s /usr/bin/python3 /usr/bin/python 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 -ENV DJANGO_SETTINGS_MODULE enterprise_access.settings.production +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 +ENV DJANGO_SETTINGS_MODULE=enterprise_access.settings.production EXPOSE 18270 EXPOSE 18271 @@ -92,13 +92,13 @@ RUN useradd -m --shell /bin/false app WORKDIR /edx/app/enterprise-access -RUN mkdir -p /requirements +RUN mkdir -p requirements -RUN curl -L -o /requirements/pip.txt https://raw.githubusercontent.com/openedx/enterprise-access/main/requirements/pip.txt -RUN curl -L -o /requirements/production.txt https://raw.githubusercontent.com/openedx/enterprise-access/main/requirements/production.txt +RUN curl -L -o requirements/pip.txt https://raw.githubusercontent.com/openedx/enterprise-access/main/requirements/pip.txt +RUN curl -L -o requirements/production.txt https://raw.githubusercontent.com/openedx/enterprise-access/main/requirements/production.txt # Dependencies are installed as root so they cannot be modified by the application user. -RUN pip install -r /requirements/pip.txt -RUN pip install -r /requirements/production.txt +RUN pip install -r requirements/pip.txt +RUN pip install -r requirements/production.txt RUN mkdir -p /edx/var/log @@ -111,12 +111,14 @@ USER app # Gunicorn 19 does not log to stdout or stderr by default. Once we are past gunicorn 19, the logging to STDOUT need not be specified. CMD gunicorn --workers=2 --name enterprise-access -c /edx/app/enterprise-access/enterprise_access/docker_gunicorn_configuration.py --log-file - --max-requests=1000 enterprise_access.wsgi:application -FROM app as newrelic +FROM app AS newrelic RUN pip install newrelic CMD newrelic-admin run-program gunicorn --workers=2 --name enterprise-access -c /edx/app/enterprise-access/enterprise_access/docker_gunicorn_configuration.py --log-file - --max-requests=1000 enterprise_access.wsgi:application -FROM app as devstack +FROM app AS devstack + USER root -RUN pip install -r /requirements/dev.txt +RUN pip install -r requirements/dev.txt + USER app CMD gunicorn --workers=2 --name enterprise-access -c /edx/app/enterprise-access/enterprise_access/docker_gunicorn_configuration.py --log-file - --max-requests=1000 enterprise_access.wsgi:application