docksal / service-vhost-proxy

Virtual host proxy service image for Docksal
http://docksal.io
MIT License
7 stars 14 forks source link

Stopped projects are no longer restarted automatically upon a HTTP request #27

Closed lmakarov closed 6 years ago

lmakarov commented 6 years ago

Starting with Docksal 1.9.0, a project that was stopped after a period of inactivity can no longer be automatically restarted by docksal-vhost-proxy upon an incoming HTTP request.

When stopping inactive projects, docksal-vhost-proxy kills the project's network, since there can only be about 30 networks define per host. When a request comes in and and there is a stopped project matching the request's Host, docksal-vhost-proxy recreates the project network and starts the project containers.

There must have been some change upstream (Docker / Docker Compose) which breaks the old workflow.

In the context of this issue the existing workflow needs to be fixed (short term solution). Long term, we may no longer need to do network cleanup for stopped projects once Docker 18.06 is released (see Expand the number of concurrently running projects)

achekulaev commented 6 years ago

There might be an easy fix for this while more complex option is in works

1.20.0

Added the --use-aliases flag to docker-compose run, indicating that
network aliases declared in the service's config should be used for the
running container

If I understand this correctly, in 1.20.0 docker-compose changed to telling containers to use networks by ID, but you can switch back to the old approach with using aliases, in which case network re-creation will not break stopped containers if it has the same alias.

If that is the case then all it takes is changing how we start containers adding yet another option there.

lmakarov commented 6 years ago

@achekulaev there is no docker-compose inside vhost-proxy. Only pure docker client goodness :D

This has been actually resolved via b0f3dba34b19081220bbdf65312f04046e3f9de9