Docker Community Forums

Share and learn in the Docker community.

Pointing custom domain to my application


(Fabienhenon) #1

Hi everyone,

I just released my first application in a staging server. (1 node, 1 container, 1 service)

Everything is working fine and I have several entry points: 1 for my node, 1 for my service and 1 for my container.
Can you tell me what is the difference between these entry points?

If I go to the node’s entry point and I have multiple containers in it, is there some kind of load balancing that will redirect me to a valid container?

Also, URLs for these entry points are ugly in term of “production ready”. I googled and the only solution I found so far was to add a CNAME entry in my DNS provider to point my domain to the entry point.

However I have several issues and questions about this:

  • Which entry point should I point to? (node, container, service)

  • I also noticed that when my application rebuilds and is redeployed (which is automatic for my staging server) the entry points change! Does it mean I have to manually update my CNAME entry to point to the new entry point? This is not an ideal solution and is not good for my Continous Deployment. Do you have a solution to do that automatically or to prevent the entry points from changing?

  • Finally - this is not the case yet - but when I’ll run multiple containers, multiple services and multiple nodes, how can I point to my application URL? Do I have to use a load balancer like Amazon’s one? Or is there a better solution with Docker Cloud?

Thank you for your help on these points!


(Andrew) #2

Node entrypoint, is just a connection to the node, and you need to have exposed ports on the node.

Service entrypoint is all containers, with the same service. So if you have multiple, it will use round-robin, between them. This also stays the same when you redeploy.

I would recommend one of those two.

You also get a container entrypoint, this is for that individual container, and if you redeploy it changes. Can be handy, but not for CNAME records.

Your second point, is to use either Node or service entrypoints.

A service endpoints, will work across nodes, and work roughly like a basic load balancer. Typically good idea to chuck something like HAPROXY on the front to help. Or just use something like AWS ELB.


(Fabienhenon) #3

Ok. Thank you for your answer, I’ll use Haproxy for the load balancing then!