How to load a file during the load of drupal 8 bootstrap (hook_init) I want to make something that in Drupal 7 can easily be done with hook_init, but this hook doesn't exists in Drupal 8.

I want to load an .env file and at the same time load the dotenv file from vendor.

I'm trying with EventSubscriber as it's plain here: https://www.drupal.org/node/2013014, but I'm not sure if this the good way.
I think that you actually already har answered your own question.
EventSubscribers is the way we do it in Drupal 8, so it might be right what you are trying to do.