diff --git a/.github/workflows/push-enterprise-catalog-image.yaml b/.github/workflows/push-enterprise-catalog-image.yaml index b411ed1..6afd67f 100644 --- a/.github/workflows/push-enterprise-catalog-image.yaml +++ b/.github/workflows/push-enterprise-catalog-image.yaml @@ -9,6 +9,11 @@ on: schedule: - cron: "0 4 * * 1-5" # UTC Time +# Added for testing purposes. Will remove once the PR is finalised + pull_request: + branches: + - '**' + jobs: build-and-push-image: runs-on: ubuntu-latest diff --git a/dockerfiles/enterprise-catalog.Dockerfile b/dockerfiles/enterprise-catalog.Dockerfile index d216d77..7c19bed 100644 --- a/dockerfiles/enterprise-catalog.Dockerfile +++ b/dockerfiles/enterprise-catalog.Dockerfile @@ -50,8 +50,7 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} RUN pip install virtualenv -# cloning git repo -RUN curl -L https://github.com/openedx/enterprise-catalog/archive/refs/heads/master.tar.gz | tar -xz --strip-components=1 +RUN mkdir -p requirements ENV VIRTUAL_ENV=/venv RUN virtualenv -p python$PYTHON_VERSION $VIRTUAL_ENV @@ -71,8 +70,13 @@ EXPOSE 8161 RUN useradd -m --shell /bin/false app + +RUN curl -L -o requirements/production.txt https://raw.githubusercontent.com/openedx/enterprise-catalog/master/requirements/production.txt RUN pip install -r requirements/production.txt +# Cloning the repository +RUN curl -L https://github.com/openedx/enterprise-catalog/archive/refs/heads/master.tar.gz | tar -xz --strip-components=1 + # Code is owned by root so it cannot be modified by the application user. # So we copy it before changing users. USER app @@ -99,6 +103,7 @@ FROM app as legacy_devapp EXPOSE 18160 EXPOSE 18161 USER root +RUN curl -L -o requirements/dev.txt https://raw.githubusercontent.com/openedx/enterprise-catalog/master/requirements/dev.txt RUN pip install -r requirements/dev.txt USER app CMD ["gunicorn", "--reload", "--workers=2", "--name", "enterprise_catalog", "-b", ":18160", "-c", "/edx/app/enterprise_catalog/enterprise_catalog/enterprise_catalog/docker_gunicorn_configuration.py", "--log-file", "-", "--max-requests=1000", "enterprise_catalog.wsgi:application"]