File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -158,13 +158,17 @@ export async function startNextcloud(branch = 'master', mountApp: boolean|string
158158 } ] ,
159159 }
160160
161+ // On macOS we need to expose the port since the docker container is running within a VM
162+ const autoExposePort = process . platform === 'darwin'
163+
161164 const container = await docker . createContainer ( {
162165 Image : SERVER_IMAGE ,
163166 name : getContainerName ( ) ,
164167 Env : [ `BRANCH=${ branch } ` , 'APCU=1' ] ,
165168 HostConfig : {
166169 Binds : mounts . length > 0 ? mounts : undefined ,
167170 PortBindings,
171+ PublishAllPorts : autoExposePort ,
168172 // Mount data directory in RAM for faster IO
169173 Mounts : [ {
170174 Target : '/var/www/html/data' ,
@@ -335,6 +339,13 @@ export const stopNextcloud = async function() {
335339export const getContainerIP = async function (
336340 container = getContainer ( )
337341) : Promise < string > {
342+ const containerInspect = await container . inspect ( )
343+ const hostPort = containerInspect . NetworkSettings . Ports [ '80/tcp' ] ?. [ 0 ] ?. HostPort
344+
345+ if ( hostPort ) {
346+ return `localhost:${ hostPort } `
347+ }
348+
338349 let ip = ''
339350 let tries = 0
340351 while ( ip === '' && tries < 10 ) {
You can’t perform that action at this time.
0 commit comments