From 75a64fa1b1a4b829e71ea85ed8ed5a9fb57a8b48 Mon Sep 17 00:00:00 2001 From: Danyal Faheem <138459282+Danyal-Faheem@users.noreply.github.com> Date: Fri, 8 Dec 2023 14:54:49 +0500 Subject: [PATCH 1/2] feat: allow post npm build patch in Dockerfile Close #167 --- .../20231208_112435_danyal.faheem_mfe_post_npm_build_patch.md | 1 + tutormfe/templates/mfe/build/mfe/Dockerfile | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 changelog.d/20231208_112435_danyal.faheem_mfe_post_npm_build_patch.md diff --git a/changelog.d/20231208_112435_danyal.faheem_mfe_post_npm_build_patch.md b/changelog.d/20231208_112435_danyal.faheem_mfe_post_npm_build_patch.md new file mode 100644 index 00000000..8d5bf3cb --- /dev/null +++ b/changelog.d/20231208_112435_danyal.faheem_mfe_post_npm_build_patch.md @@ -0,0 +1 @@ +- [Feature] Added patch to allow changes to Dockerfile after the npm build has completed. (by @Danyal-Faheem) \ No newline at end of file diff --git a/tutormfe/templates/mfe/build/mfe/Dockerfile b/tutormfe/templates/mfe/build/mfe/Dockerfile index f0d74c26..2a55fb0a 100644 --- a/tutormfe/templates/mfe/build/mfe/Dockerfile +++ b/tutormfe/templates/mfe/build/mfe/Dockerfile @@ -93,6 +93,8 @@ CMD ["/bin/bash", "-c", "npm run start --- --config ./webpack.dev-tutor.config.j FROM {{ app_name }}-common AS {{ app_name }}-prod ENV NODE_ENV=production RUN npm run build +{{ patch("mfe-dockerfile-post-npm-build") }} +{{ patch("mfe-dockerfile-post-npm-build-{}".format(app_name)) }} {% endfor %} ####### final production image with all static assets From 084f09e1385a203502d5c7e5770d5dff822a9a1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Fri, 8 Dec 2023 11:27:42 +0100 Subject: [PATCH 2/2] fix: auto-build mfe image in nightly See: https://discuss.openedx.org/t/error-response-from-daemon-manifest-for-overhangio-openedx-mfe-16-1-3-nightly-not-found/11881 --- changelog.d/20231208_112710_regis_nightly_auto_build_mfe.md | 1 + tutormfe/plugin.py | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 changelog.d/20231208_112710_regis_nightly_auto_build_mfe.md diff --git a/changelog.d/20231208_112710_regis_nightly_auto_build_mfe.md b/changelog.d/20231208_112710_regis_nightly_auto_build_mfe.md new file mode 100644 index 00000000..453cf083 --- /dev/null +++ b/changelog.d/20231208_112710_regis_nightly_auto_build_mfe.md @@ -0,0 +1 @@ +- [Bugfix] Auto-build "mfe" image during `dev/local launch` in nightly. (by @regisb) diff --git a/tutormfe/plugin.py b/tutormfe/plugin.py index 5ca92213..e2205567 100644 --- a/tutormfe/plugin.py +++ b/tutormfe/plugin.py @@ -242,6 +242,10 @@ def _print_mfe_public_hosts( def _build_3rd_party_dev_mfes_on_launch( image_names: list[str], context_name: t.Literal["local", "dev"] ) -> list[str]: + if __version_suffix__: + # Build mfe image in nightly mode + image_names.append("mfe") + for mfe_name, _mfe_attrs in iter_mfes(): if __version_suffix__ or ( context_name == "dev" and mfe_name not in CORE_MFE_APPS