ItsEcholot / ContainerNursery

Puts Docker Containers to sleep and wakes them back up when they're needed
MIT License
94 stars 6 forks source link

Additional Solution: Configurable Proxy Listening Port #14

Closed everythingguy closed 2 years ago

everythingguy commented 2 years ago

Here is another way to achieve #1 as an alternative to #13 Here I utilize an event emitter instead of an exported function.

everythingguy commented 2 years ago

Resolves #1

ItsEcholot commented 2 years ago

I like the event emitter approach, I will review & test this tomorrow.

ItsEcholot commented 2 years ago

The dev tag docker image (sha256:8021d281e0c43d7d68d54e4ac26f3f4f272cb96278e947c758819fb3b5b2f370) contains a build of this PR and is used for testing.

everythingguy commented 2 years ago

How's your testing going? Everything seems to be working fine on my end.

ItsEcholot commented 2 years ago

Could you add a check that prevents the user from setting the proxy port to the same as is internally used for the placeholder express server (8080)? If both services use the same port, the express server takes precedence and renders the placeholder view, without a container name, which obviously won't ever reload to the actual application since it's not proxied.

It shouldn't be too much of a problem since the express server only listens on the loopback interface 127.0.0.1, and most users won't run this application on the device their using to also access it, but using the same port twice isn't a good idea either way.