From 8e48ffb2885b693a28f75054d8454f54074083c5 Mon Sep 17 00:00:00 2001 From: Maria Fernanda Magallanes Zubillaga Date: Wed, 15 Nov 2023 16:57:24 -0500 Subject: [PATCH] feat: allows you to add extra pip requirements to your codejail sandbox --- tutorcodejail/templates/codejail/build/codejail/Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tutorcodejail/templates/codejail/build/codejail/Dockerfile b/tutorcodejail/templates/codejail/build/codejail/Dockerfile index d2ce8c1..8d8edb2 100644 --- a/tutorcodejail/templates/codejail/build/codejail/Dockerfile +++ b/tutorcodejail/templates/codejail/build/codejail/Dockerfile @@ -54,6 +54,12 @@ RUN mkdir -p common/lib/ COPY --from={{ DOCKER_IMAGE_OPENEDX }} /openedx/edx-platform/requirements/edx-sandbox/py38.txt py38.txt RUN pip3 install -r py38.txt +# Allows you to add extra pip requirements to your codejail sandbox. +{% if CODEJAIL_EXTRA_PIP_REQUIREMENTS is defined %} +{% for extra_requirements in CODEJAIL_EXTRA_PIP_REQUIREMENTS %}RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/openedx/.cache/pip,sharing=shared {% endif %}pip install '{{ extra_requirements }}' +{% endfor %} +{% endif %} + ##### Prod image FROM minimal as production