Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
Dockerfile
README.md
app.js
package-lock.json
package.json
task-definition.json

README.md

Quickstart for debugging a Docker based Node app Deployed in AWS ECS using Rookout

A sample application for debugging a Docker based Node app Deployed in AWS ECS using Rookout.

Before following this guide we recommend reading the basic Node + Rookout guide.

This sample may be out of date. If you face any issues, please reach out to mailto:support@rookout.com and let us know.

Rookout Integration Explained

There are 2 simple steps to integrate Rookout into your existing Node application:

  1. Add the npm dependency rookout

  2. Set the Rookout ETL Controller configuration as environment variables in the Docker container

Running locally

Requirements: node, docker

  1. Run docker build --tag node-ecs-example . && docker run -it -p 8080:8080 -e "ROOKOUT_TOKEN=<TOKEN>" node-ecs-example

  2. Open http://localhost:8080/ to make sure everything works

  3. Go to http://app.rookout.com and start debugging!

Running on ECS

  1. Build & Upload docker image using this guide to Amazon ECR

    • Follow instructions in the link in order to create and upload to the repository
  2. Create a task definition in Amazon ECS

    • Enter a name for your task definition - e.g. rookout-test-ecs
    • Leave the rest as default and click on Add container under the Container Definitions title and configure as follows:
    • Container name - e.g. agentless-node-app
    • Image - [registry-url]/[namespace]/[image]:[tag]
      • Example: 123412345738.dkr.ecr.eu-central-1.amazonaws.com/rookout/ecs-test:1.0
    • Memory Limits: Hard limit: 128
    • Port mappings: Host 80 / Container 8080
    • Environment
      • Env Variable: ROOKOUT_TOKEN

    Or using JSON Configuration :

    {
      "containerDefinitions": [
        {
          "memory": 128,
          "volumesFrom": [],
          "image": "[registry-url]/[namespace]/[image]:[tag]",
          "name": "rook-test-task",
          "portMappings": [
            {
              "hostPort": 80,
              "protocol": "tcp",
              "containerPort": 8080
            }
          ],
          "environment": [
            {
              "name": "ROOKOUT_TOKEN",
              "value": "TOKEN"
            }
          ]
        }
      ]
    }
  3. Click create on the bottom right, and finish up the task wizard.

  4. Last step is to create or use an existing cluster, run this task and start debugging at https://app.rookout.com

Rookout Integration Process

We have added Rookout to the original project by:

  1. Installing the Rookout SDK: npm install --save rookout and adding it in the entry file const rookout = require('rookout/auto_start');

  2. Setting up the Rookout SDK by setting the following environment variable: ROOKOUT_TOKEN.

You can’t perform that action at this time.