diff --git a/src/app_list.ts b/src/app_list.ts index 08d53e3..6ef931c 100644 --- a/src/app_list.ts +++ b/src/app_list.ts @@ -13,7 +13,7 @@ function name(app: App, container: Container) { } export default function list(apps: App[], options: { fields?: string[] } = {}) { - const head = ['', 'App', 'Status', 'Uptime', 'Forwarding', 'Source'].concat(options.fields || []) + const head = ['', 'App', 'Status', 'Uptime', 'Forwarding', 'IP', 'Source'].concat(options.fields || []) const table = new Table({ head: head, style: { head: ['cyan'] }, @@ -38,6 +38,7 @@ export default function list(apps: App[], options: { fields?: string[] } = {}) { container.state, container.uptime?.replace(' ago', ''), container.forwardedPorts.join(', '), + container.ipAddresses.join(', '), app.containers.length == 1 ? source : '', ] diff --git a/src/container.ts b/src/container.ts index a4aa7db..d44a2dd 100644 --- a/src/container.ts +++ b/src/container.ts @@ -131,6 +131,10 @@ export default class Container { return [...new Set(ports)] } + get ipAddresses(): string[] { + return (Object.values(this.attributes.NetworkSettings?.Networks) || []).map(network => network['IPAddress']) + } + async down() { return docker.compose(this.context, `stop ${this.name}`, this.composeFile) }