@@ -9,6 +9,10 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
99 apt update && \
1010 apt install -y build-essential curl git language-pack-en
1111ENV LC_ALL=en_US.UTF-8
12+
13+ COPY --from=ghcr.io/astral-sh/uv:0.4.21 /uv /usr/local/bin/uv
14+ ARG PIP_COMMAND="uv pip"
15+
1216{{ patch("openedx-dockerfile-minimal" ) }}
1317
1418# ##### Install python with pyenv in /opt/pyenv and create virtualenv in /openedx/venv
5155{{ patch("openedx-dockerfile-git-patches-default" ) }}
5256{%- elif EDX_PLATFORM_VERSION == "master" %}
5357# Patches in nightly node
58+ RUN curl -fsSL https://github.com/openedx/edx-platform/commit/3642cab3ac61ddfd360e7ceb7463b52be8c4deb0.patch | git am
5459{%- else %}
5560# Patches in non-nightly mode
61+
5662{%- endif %}
5763
5864{# Example: RUN curl -fsSL https://github.com/openedx/edx-platform/commit/<GITSHA1>.patch | git am #}
@@ -74,6 +80,7 @@ FROM python AS python-requirements
7480ENV PATH=/openedx/venv/bin:${PATH}
7581ENV VIRTUAL_ENV=/openedx/venv/
7682ENV XDG_CACHE_HOME=/openedx/.cache
83+ ENV UV_CACHE_DIR=$XDG_CACHE_HOME/pip
7784
7885RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
7986 --mount=type=cache,target=/var/lib/apt,sharing=locked \
@@ -91,11 +98,11 @@ RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared \
9198# Install base requirements
9299RUN --mount=type=bind,from=edx-platform,source=/requirements/edx/base.txt,target=/openedx/edx-platform/requirements/edx/base.txt \
93100 --mount=type=cache,target=/openedx/.cache/pip,sharing=shared \
94- pip install -r /openedx/edx-platform/requirements/edx/base.txt
101+ $PIP_COMMAND install -r /openedx/edx-platform/requirements/edx/base.txt
95102
96103# Install extra requirements
97104RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared \
98- pip install \
105+ $PIP_COMMAND install \
99106 # Use redis as a django cache https://pypi.org/project/django-redis/
100107 django-redis==5.4.0 \
101108 # uwsgi server https://pypi.org/project/uWSGI/
@@ -104,20 +111,21 @@ RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared \
104111{{ patch("openedx-dockerfile-post-python-requirements" ) }}
105112
106113# Install scorm xblock
107- RUN pip install "openedx-scorm-xblock>=18.0.0,<19.0.0"
114+ RUN $PIP_COMMAND install "openedx-scorm-xblock>=18.0.0,<19.0.0"
108115
109116{% for extra_requirements in OPENEDX_EXTRA_PIP_REQUIREMENTS %}
110117RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared \
111- pip install '{{ extra_requirements }}'
118+ $PIP_COMMAND install '{{ extra_requirements }}'
112119{% endfor %}
113120
114121# ##### Install nodejs with nodeenv in /openedx/nodeenv
115122FROM python AS nodejs-requirements
123+ ENV VIRTUAL_ENV=/openedx/venv/
116124ENV PATH=/openedx/nodeenv/bin:/openedx/venv/bin:${PATH}
117125
118126# Install nodeenv with the version provided by edx-platform
119127# https://github.com/openedx/edx-platform/blob/master/requirements/edx/base.txt
120- RUN pip install nodeenv==1.8.0
128+ RUN $PIP_COMMAND install nodeenv==1.8.0
121129RUN nodeenv /openedx/nodeenv --node=18.20.1 --prebuilt
122130
123131# Install nodejs requirements
@@ -174,12 +182,12 @@ WORKDIR /openedx/edx-platform
174182{# Install auto-mounted directories as Python packages. #}
175183{% for name in iter_mounted_directories(MOUNTS, "openedx" ) %}
176184COPY --link --chown=$APP_USER_ID:$APP_USER_ID --from=mnt-{{ name }} / /mnt/{{ name }}
177- RUN pip install -e "/mnt/{{ name }}"
185+ RUN $PIP_COMMAND install -e "/mnt/{{ name }}"
178186{% endfor %}
179187
180188# We install edx-platform here because it creates an egg-info folder in the current
181189# repo. We need both the source code and the virtualenv to run this command.
182- RUN pip install -e .
190+ RUN $PIP_COMMAND install -e .
183191
184192# Create folder that will store lms/cms.env.yml files, as well as
185193# the tutor-specific settings files.
@@ -260,16 +268,16 @@ USER app
260268
261269# Install dev python requirements
262270RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared \
263- pip install -r requirements/edx/development.txt
271+ $PIP_COMMAND install -r requirements/edx/development.txt
264272# https://pypi.org/project/ipdb/
265273# https://pypi.org/project/ipython (>=Python 3.10 started with 8.20)
266274RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared \
267- pip install ipdb==0.13.13 ipython==8.24.0
275+ $PIP_COMMAND install ipdb==0.13.13 ipython==8.24.0
268276
269277{# Re-install mounted requirements, otherwise they will be superseded by upstream reqs #}
270278{% for name in iter_mounted_directories(MOUNTS, "openedx" ) %}
271279COPY --link --chown=$APP_USER_ID:$APP_USER_ID --from=mnt-{{ name }} / /mnt/{{ name }}
272- RUN pip install -e "/mnt/{{ name }}"
280+ RUN $PIP_COMMAND install -e "/mnt/{{ name }}"
273281{% endfor %}
274282
275283# Add ipdb as default PYTHONBREAKPOINT
0 commit comments