# MFE apps
{% for app in iter_values_named(suffix="MFE_APP") %}
{{ app["name"] }}:
    image: {{ app["name"] }}
    build:
        context: ../plugins/mfe/build/mfe/
        target: {{ app["name"] }}-dev
    ports:
        - "127.0.0.1:{{ app["port"] }}:{{ app["port"] }}"
    volumes:
        - ../plugins/mfe/apps/mfe/webpack.dev.config.js:/openedx/app/webpack.dev.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 %}
