diff --git a/tutormfe/patches/local-docker-compose-dev-services b/tutormfe/patches/local-docker-compose-dev-services index 482c3c58..fcadfca7 100644 --- a/tutormfe/patches/local-docker-compose-dev-services +++ b/tutormfe/patches/local-docker-compose-dev-services @@ -11,15 +11,4 @@ tty: true volumes: - ../plugins/mfe/apps/mfe/webpack.dev-tutor.config.js:/openedx/app/webpack.dev-tutor.config.js:ro - env_file: - - ../plugins/mfe/build/mfe/env/production - - ../plugins/mfe/build/mfe/env/development - environment: - - "PORT={{ app['port'] }}" - {%- for key, value in app.get("env", {}).get("production", {}).items() %} - - "{{ key }}={{ value }}" - {% endfor %} - {%- for key, value in app.get("env", {}).get("development", {}).items() %} - - "{{ key }}={{ value }}" - {%- endfor %} {% endfor %} diff --git a/tutormfe/templates/mfe/build/mfe/Dockerfile b/tutormfe/templates/mfe/build/mfe/Dockerfile index de432834..81214f82 100644 --- a/tutormfe/templates/mfe/build/mfe/Dockerfile +++ b/tutormfe/templates/mfe/build/mfe/Dockerfile @@ -54,21 +54,36 @@ COPY --from={{ app["name"] }}-src /openedx/app /openedx/app COPY --from={{ app["name"] }}-i18n /openedx/app/src/i18n/messages /openedx/app/src/i18n/messages ENV PUBLIC_PATH='/{{ app["name"] }}/' EXPOSE {{ app['port'] }} -CMD ["npm", "run", "start", "---", "--config", "./webpack.dev-tutor.config.js"] -{% endfor %} - -{% for app in iter_values_named(suffix="MFE_APP") %} - -######## {{ app["name"] }} (production) -FROM {{ app["name"] }}-dev AS {{ app["name"] }} COPY ./env/production /openedx/env/production RUN touch /openedx/env/production.override \ {%- for key, value in app.get("env", {}).get("production", {}).items() %} && echo "{{ key }}='{{ value }}'" >> /openedx/env/production.override \ {%- endfor %} && echo "done setting production overrides" -RUN bash -c "set -a && source /openedx/env/production && source /openedx/env/production.override && npm run build" +COPY ./env/development /openedx/env/development +RUN touch /openedx/env/development.override \ + {%- for key, value in app.get("env", {}).get("development", {}).items() %} + && echo "{{ key }}='{{ value }}'" >> /openedx/env/development.override \ + {%- endfor %} + && echo "done setting development overrides" + +CMD ["/bin/bash", "-c", "set -a && \ + source /openedx/env/production && \ + source /openedx/env/production.override && \ + source /openedx/env/development && \ + source /openedx/env/development.override && \ + npm run start --- --config ./webpack.dev-tutor.config.js"] +{% endfor %} + +{% for app in iter_values_named(suffix="MFE_APP") %} + +######## {{ app["name"] }} (production) +FROM {{ app["name"] }}-dev AS {{ app["name"] }} +RUN bash -c "set -a && \ + source /openedx/env/production && \ + source /openedx/env/production.override && \ + npm run build" {% endfor %} diff --git a/tutormfe/templates/mfe/build/mfe/env/production b/tutormfe/templates/mfe/build/mfe/env/production index 07f7055b..cf224b51 100644 --- a/tutormfe/templates/mfe/build/mfe/env/production +++ b/tutormfe/templates/mfe/build/mfe/env/production @@ -19,7 +19,7 @@ NODE_ENV=production PUBLISHER_BASE_URL= REFRESH_ACCESS_TOKEN_ENDPOINT={% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/login_refresh SEGMENT_KEY= -SITE_NAME={{ PLATFORM_NAME|replace("'", "'\\''")|replace(" ", "\ ") }} +SITE_NAME="{{ PLATFORM_NAME }}" STUDIO_BASE_URL={{ "https" if ENABLE_HTTPS else "http" }}://{{ CMS_HOST }} USER_INFO_COOKIE_NAME=user-info