What is the role of the noddejs container in a Sylius docker deployment

What exactly is the role of the nodejs container in the docker-compose file for Sylius Standard?

I understand that it is used to build the frontend assets. However, couldn’t you just run yarn build on the symfony project’s image (sylius_php)? Or does the nodejs container perform some other function after deployment? If so, why is this container not present in the production docker-compose file?

It’s role is to build the frontend assets. You can’t do that in the PHP container in this setup because NodeJS and other relevant libraries are not installed there.
It’s not present in the production setup because it’s not recommended to build assets in production environments, but rather build them locally or on a staging server and push to the production server/storage/cdn.

1 Like