diff --git a/tutordiscovery/plugin.py b/tutordiscovery/plugin.py index 3e36638..8132828 100644 --- a/tutordiscovery/plugin.py +++ b/tutordiscovery/plugin.py @@ -32,6 +32,8 @@ "OAUTH2_KEY_SSO_DEV": "discovery-sso-dev", "CACHE_REDIS_DB": "{{ OPENEDX_CACHE_REDIS_DB }}", "EXTRA_PIP_REQUIREMENTS": [], + "ATLAS_PULL": False, + "ATLAS_ARGS": "", }, } diff --git a/tutordiscovery/templates/discovery/build/discovery/Dockerfile b/tutordiscovery/templates/discovery/build/discovery/Dockerfile index 92fa176..389f215 100644 --- a/tutordiscovery/templates/discovery/build/discovery/Dockerfile +++ b/tutordiscovery/templates/discovery/build/discovery/Dockerfile @@ -60,9 +60,18 @@ RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/openedx/.cache/pip, # Use redis as a django cache https://pypi.org/project/django-redis/ django-redis==5.2.0 \ # uwsgi server https://pypi.org/project/uWSGI/ - uwsgi==2.0.21 + uwsgi==2.0.21 \ + # Open edX Atlas tranlsation management tool https://pypi.org/project/openedx-atlas/ + openedx-atlas'<1.0.0' + +# Update i18n and collect static assets +{% if DISCOVERY_ATLAS_PULL %} +RUN find course_discovery/conf/locale -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \; \ + && cd course_discovery/conf \ + && atlas pull {{ DISCOVERY_ATLAS_ARGS }} \ + translations/course-discovery/course_discovery/conf/locale:locale +{% endif %} -# Collect static assets COPY --chown=app:app assets.py ./course_discovery/settings/assets.py RUN DJANGO_SETTINGS_MODULE=course_discovery.settings.assets make static