Docker links with awsvpc network mode

后端 未结 2 1424
野性不改
野性不改 2021-01-15 10:27

I have a Java webapp deployed in ECS using the tomcat:8.5-jre8-alpine image. The network mode for this task is awsvpc; I have many of these tasks running across 3 EC2 instan

相关标签:
2条回答
  • 2021-01-15 10:35

    You dont need the linking part at all, because awsvpc allows you to reference other containers simply by using

    localhost:8080 (or whatever port is your other container mapped to)

    in your nginx config file.

    So remove links from your json and use localhost:{container-port} in nginx config. Simple as that.

    0 讨论(0)
  • 2021-01-15 10:54

    Actually if you want to use a reverse-proxy you can stop using links, because you can make service discovery or using your reverse-proxy to use your dependency.

    If you still want to use link instead of using that reverse proxy you can use consul and Fabio. Both services are dockerizable.

    With this, there is no necessity to use awsvpc and you can use consul for service-discovery.

    Hope it helps!

    0 讨论(0)
提交回复
热议问题