diff --git a/Makefile b/Makefile index 68a7642..a632c59 100644 --- a/Makefile +++ b/Makefile @@ -173,9 +173,6 @@ endif ifdef EDX_PLATFORM_VERSION openedx_build_args += --build-arg="EDX_PLATFORM_VERSION=$(EDX_PLATFORM_VERSION)" endif -ifdef THEMES - openedx_build_args += --build-arg="THEMES=$(THEMES)" -endif build-openedx: ## Build the Open edX docker image docker build -t regis/openedx:latest -t regis/openedx:hawthorn $(openedx_build_args) openedx/ diff --git a/README.md b/README.md index 3f1b15c..f417224 100644 --- a/README.md +++ b/README.md @@ -278,9 +278,9 @@ Comprehensive theming is enabled by default. Put your themes in `openedx/themes` mycustomtheme2/ ... -Then you must rebuild the openedx Docker image and indicate which themes you want to build: +Then you must rebuild the openedx Docker image: - make build-openedx THEMES=mycustomtheme1,mycustomtheme2,dark-theme + make build-openedx Make sure the assets can be served by the web server: diff --git a/openedx/Dockerfile b/openedx/Dockerfile index eafca4b..84021bf 100644 --- a/openedx/Dockerfile +++ b/openedx/Dockerfile @@ -80,9 +80,7 @@ COPY settings/cms/*.py /openedx/config/universal/cms/ # Collect production assets. By default, only assets from the default theme # will be processed. This makes the docker image lighter and faster to build. -# To compile assets from other themes, build the image with the THEMES -# argument: THEMES=dark-theme,edx.org -# Custom themes added to /openedx/themes can also be compiled. +# Only the custom themes added to /openedx/themes will be compiled. # Here, we don't run "paver update_assets" which is slow, compiles all themes # and requires a complex settings file. Instead, we decompose the commands # and run each one individually to collect the production static assets to @@ -95,9 +93,8 @@ COPY settings/cms/*.py /openedx/config/universal/cms/ RUN xmodule_assets common/static/xmodule \ && python -c "import pavelib.assets; pavelib.assets.process_npm_assets()" \ && STATIC_ROOT_LMS=/openedx/data/staticfiles STATIC_ROOT_CMS=/openedx/data/staticfiles/studio NODE_ENV=production ./node_modules/.bin/webpack --config=webpack.prod.config.js -ARG THEMES=open-edx COPY ./themes/ /openedx/themes/ -RUN paver compile_sass --theme-dirs=/openedx/edx-platform/themes,/openedx/themes --themes=$THEMES \ +RUN paver compile_sass --theme-dirs=/openedx/edx-platform/themes,/openedx/themes --themes=open-edx,$(ls /openedx/themes | paste -s -d, -) \ && python -c "import pavelib.assets; pavelib.assets.collect_assets(['lms', 'cms'], 'universal.assets')" # service variant is "lms" or "cms"