Closed lmakarov closed 6 years ago
This is available in docksal/vhost-proxy:edge
and will be release in the next release (by end of month).
Example nodejs project utilizing this feature: https://github.com/docksal/example-nodejs
Example standalone nodejs container:
fin docker run -d --name=nodejs \
-v $(pwd):/app \
--label=io.docksal.virtual-host=nodejs.docksal \
--label=io.docksal.virtual-port=3000 \
--expose 3000 \
node:alpine \
node /app/index.js
docksal-vhost-proxy only supports routing ports 80/443 on the host to ports 80/443 in containers.
In certain cases containers may have to use a different port. E.g. nodejs apps use port
3000
by default. Binding to privileged ports (80/443) requires running nodejs as root, which is not desirable.This functionality exists in jwilder/nginx-proxy and can be borrowed from there: https://github.com/jwilder/nginx-proxy#multiple-ports