findPort method
Implementation
Future<int> findPort(
String projectId,
String service,
int containerPort,
) async {
final process = await io.Process.start('docker', [
'compose',
'-p',
projectId,
'-f',
'-',
'port',
service,
'$containerPort',
]);
process.stdin.write(compose);
await process.stdin.close();
final output = await utf8.decodeStream(process.stdout);
return int.parse(output.split(':').last);
}