@@ -348,16 +348,26 @@ def docker_compose_down(compose_files: List[str], project_name: str):
348
348
349
349
def wait_for_nginxproxy_to_be_ready ():
350
350
"""
351
- If one (and only one) container started from image nginxproxy/nginx-proxy:test is found,
352
- wait for its log to contain substring "Watching docker events"
351
+ If one (and only one) container started from image nginxproxy/nginx-proxy:test
352
+ or nginxproxy/docker-gen:latest is found, wait for its log to contain the substring "Watching docker events"
353
353
"""
354
- containers = docker_client .containers .list (filters = {"ancestor" : "nginxproxy/nginx-proxy:test" })
355
- if len (containers ) != 1 :
354
+ nginx_proxy_containers = docker_client .containers .list (filters = {"ancestor" : "nginxproxy/nginx-proxy:test" })
355
+ docker_gen_containers = docker_client .containers .list (filters = {"ancestor" : "nginxproxy/docker-gen:latest" })
356
+
357
+ container_name = "nginx-proxy"
358
+
359
+ if len (nginx_proxy_containers ) == 1 :
360
+ container = nginx_proxy_containers .pop ()
361
+ elif len (docker_gen_containers ) == 1 :
362
+ container = docker_gen_containers .pop ()
363
+ container_name = "docker-gen"
364
+ else :
365
+ logging .debug ("Either more than one or no nginx-proxy or docker-gen container found, skipping container readiness check" )
356
366
return
357
- container = containers [ 0 ]
367
+
358
368
for line in container .logs (stream = True ):
359
369
if b"Watching docker events" in line :
360
- logging .debug ("nginx-proxy ready" )
370
+ logging .debug (f" { container_name } ready" )
361
371
break
362
372
363
373
0 commit comments