Skip to content

gnokoheat/ecs-reverse-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ecs-reverse-proxy

GitHub Docker Pulls GitHub repo size GitHub last commit

AWS ECS reverse proxy using HA Proxy

  • In case of dynamic port mapping, you can set HA-Proxy revere proxy container linking your app container.

Usage

  • Environment variables for linking with app : LINK_APP, LINK_PORT
  • Task definition (taskdef.json) example
"containerDefinitions": [
      // 1. reverse proxy container
      {
        "name": "<APP_NAME>-rp",
        "image": "gnokoheat/ecs-reverse-proxy:latest",
        "essential": true,
        "memoryReservation": 128,
        "portMappings": [
          {
            "hostPort": 0,
            "containerPort": 80,
            "protocol": "tcp"
          }
        ],
        "links": [
          "<APP_NAME>"
        ],
        "environment": [
          {
            "name": "LINK_PORT",
            "value": "<SERVICE_PORT>"
          },
          {
            "name": "LINK_APP",
            "value": "<APP_NAME>"
          }
        ]
      },
      // 2. app container
      {
        "name": "<APP_NAME>",
        ...
      }
]
  • Get the docker hub image
docker pull gnokoheat/ecs-reverse-proxy:latest

Related