Skip to content

Commit

Permalink
perf: globally install node_modules
Browse files Browse the repository at this point in the history
WIP
  • Loading branch information
kdmccormick committed Jan 10, 2023
1 parent e987db4 commit 4df47d4
Show file tree
Hide file tree
Showing 2 changed files with 325 additions and 29 deletions.
12 changes: 6 additions & 6 deletions tutor/templates/build/openedx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ ENV PATH /openedx/nodeenv/bin:/openedx/venv/bin:${PATH}
RUN pip install nodeenv==1.7.0
RUN nodeenv /openedx/nodeenv --node=16.14.0 --prebuilt

# Install nodejs requirements
# Install nodejs requirements to /openedx/node_modules
ARG NPM_REGISTRY={{ NPM_REGISTRY }}
COPY --from=code /openedx/edx-platform/package.json /openedx/edx-platform/package.json
COPY --from=code /openedx/edx-platform/package-lock.json /openedx/edx-platform/package-lock.json
WORKDIR /openedx/edx-platform
COPY --from=code /openedx/edx-platform/package.json /openedx/package.json
COPY --from=code /openedx/edx-platform/package-lock.json /openedx/package-lock.json
WORKDIR /openedx
RUN npm install --verbose --registry=$NPM_REGISTRY

###### Production image with system and python requirements
Expand All @@ -132,9 +132,9 @@ COPY --chown=app:app --from=python /opt/pyenv /opt/pyenv
COPY --chown=app:app --from=python-requirements /openedx/venv /openedx/venv
COPY --chown=app:app --from=python-requirements /openedx/requirements /openedx/requirements
COPY --chown=app:app --from=nodejs-requirements /openedx/nodeenv /openedx/nodeenv
COPY --chown=app:app --from=nodejs-requirements /openedx/edx-platform/node_modules /openedx/edx-platform/node_modules
COPY --chown=app:app --from=nodejs-requirements /openedx/node_modules /openedx/node_modules

ENV PATH /openedx/venv/bin:./node_modules/.bin:/openedx/nodeenv/bin:${PATH}
ENV PATH /openedx/venv/bin:/openedx/node_modules/.bin:/openedx/nodeenv/bin:${PATH}
ENV VIRTUAL_ENV /openedx/venv/
WORKDIR /openedx/edx-platform

Expand Down
Loading

0 comments on commit 4df47d4

Please sign in to comment.