Drupal Console lets you interact with your Drupal installation, and generate boilerplate code from the command line. Now you can get Console in a container! This container is similar to the official Drush container; pass switches and options to docker run.
Mount your Drupal docroot in the Console container and add networks and links as necessary. When running, be sure to pass the --root and --uri switches for Console to find your installation of Drupal.
docker-compose run console --root=/var/www/html --uri=http://web/ module:install flag