6

I have a Docker container running on AWS ECS. I don't want a load balancer because the container is meant to handle websocket connections.

https://aws.amazon.com/getting-started/tutorials/deploy-docker-containers/ shows reaching the container using a load balancer DNS name. But since I didn't add a load balancer, I see no way to reach the container.

How do I establish a websocket connection to a Docker container running on ECS without a load balancer?

vanekjar
  • 2,386
  • 14
  • 23
Jordan
  • 3,813
  • 4
  • 24
  • 33
  • 3
    have you tried cloud map + service discovery ? – sayboras Dec 02 '19 at 12:33
  • @Apolozeus, I haven't, I'll take a look, thank you! – Jordan Dec 02 '19 at 21:24
  • 3
    no worry, I am using cloud map + service discovery for one of the service. You need to make sure that consumer can resolve the DNS entry from service discovery :). As there is no LB, just make sure that consumer will not cache DNS for long time. – sayboras Dec 03 '19 at 00:13
  • Did you ever find out how to access the container without a load balancer? – per_jansson Nov 21 '20 at 21:32
  • 2
    @per_jansson, no I ended up just using Digital Ocean's App Platform. It's exceptionally easy to use, you just point it at your Dockerfile, it builds the image and runs it, and makes it available to the web. – Jordan Nov 23 '20 at 11:32

1 Answers1

2

You can use a load balancer for websocket connections - it has to be an Application Loadbalancer though, and iirc, you need to specify the listener as tcp, not http(s).

Adriaan Pelzer
  • 1,379
  • 1
  • 8
  • 5