Skip to content

Commit

Permalink
fix: corrected requirements dir path for enterprise_access(#45)
Browse files Browse the repository at this point in the history
* fix: corrected requirements dir path for enterprise_access
  • Loading branch information
huniafatima-arbi authored Oct 28, 2024
1 parent 58e8a6e commit 7001d68
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions dockerfiles/enterprise-access.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:focal as app
FROM ubuntu:focal AS app
MAINTAINER [email protected]

Check warning on line 2 in dockerfiles/enterprise-access.Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push-image

The MAINTAINER instruction is deprecated, use a label instead to define an image author

MaintainerDeprecated: Maintainer instruction is deprecated in favor of using label More info: https://docs.docker.com/go/dockerfile/rule/maintainer-deprecated/


Expand Down Expand Up @@ -81,24 +81,24 @@ 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
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

Expand All @@ -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

Check warning on line 112 in dockerfiles/enterprise-access.Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push-image

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/

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

Check warning on line 124 in dockerfiles/enterprise-access.Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push-image

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/

0 comments on commit 7001d68

Please sign in to comment.