Question about docker-compose file in devstack

So I was looking to the docker-compose in the devstack

And I was wondering regarding this comment

  # ==========================================================================
  # edX Microfrontends
  #
  # TODO: Instead of having an nginx container for every single microfrontend
  # (there are like 12 now, right?), we should come up with an actual strategy
  # for micro-frontends in devtack.
  # ==========================================================================

src

Where or how does these microfrontends services uses nginx, I mean where in the code is stated that those services depends on nginx?

Nginx or any other web server is required to serve MFEs. They are static HTML/JS/CSS files. Is there any other option to deliver these files to the user?

I believe you didn’t understand my question correctly.

I am not asking why MFE needs nginx, I just ask where is it stated in docker configuration for example that MFE depends on nginx.

And for the record yes there are other ways static files could be served for example Apache server, but again this is not relevant for my inquiry.

Also for more context, in the devstack is using the node:12 image as stated in the microfrontend.yml file

    image: node:12
    environment:
      - NODE_ENV=development

The node:12 is the official image from node, however this image is usually used for development purpose and is not recommended for production, hence it doesn’t use nginx. Which to my understnding shall make the comment I qouted above irrelevant.

Ref:

  • Official node docker images repo

Well, obviously there is no Nginx container used to host MFEs as you noted. however, I think there is a plan to aggregate (centralize) all MFEs within a single container with a web server like Nginx. I’m not aware of the details but you can read more and ask your questions in this thread.
I hope it helps

P.S: As you know devstack is not recommended for production environments.

1 Like

Thank you @mahyard, that makes more sense.

And yes, I am aware that the devstack is for the development purpose, but I just wanted to make sense of it’s architecture and that comment really confused me!. I start looking for where is the nginx services is defined.
I guess it’s better to reword it, to reflect the true nature of the devstack. something like:

Todo: wrap all MFE in one nginx container, check (the thread you linked...etc)

I guess that would make more sense.

Those lines are added by Kyle McCormick
Perhaps he can make it more clear for you
Would you give your opinion here? @kmccormick

Sorry for the confusion @ghassan – I was mistaken when I wrote that comment. It should say Instead of having a node container for every single microfrontend...

As you and @mahyard seem to already be aware, this comment is expressing my desire that we hosted all MFEs from a single container instead of requiring a dozen or so containers to run all of them. I wasn’t able to follow up on that, but it’s exciting to see that others have been looking into it.

1 Like