Sign inSign up

nishadangre/elasticsearch-webhook

By nishadangre

Updated 3 months ago

Image
0

1.9K

nishadangre/elasticsearch-webhook repository overview

🪝 Webhook to Elasticsearch – NestJS + Docker

This Docker image provides a lightweight webhook service built with NestJS 11 (running on Node.js 22) that forwards incoming JSON POST payloads to a specified Elasticsearch index.


📦 Features

  • ✅ Simple webhook listener on POST /
  • ✅ Secure Elasticsearch integration with basic auth
  • ✅ Environment-driven configuration
  • ✅ Built-in Docker support for easy deployment

⚙️ Environment Variables

The container expects a .env file in the following format:

# App
NODE_ENV=production
PORT=3000

# Elasticsearch
ES_NODE=https://elastichost:9200
ES_USERNAME=username
ES_PASSWORD=password
ES_INDEX=index-name

🚀 Usage

Make sure your .env file is placed alongside your Docker command. Then run:

docker run -p 3000:3000 --env-file .env nishadangre/elasticsearch-webhook

Replace your-dockerhub-user/webhook-to-es with the actual Docker Hub image name.


📤 Example API Request

Once the container is running and listening on port 3000, you can send a POST request like this:

curl -X POST http://localhost:3000/webhook \
  -H "Content-Type: application/json" \
  -d '{
        "userId": 123,
        "action": "purchase",
        "product": "Tour Package A",
        "timestamp": "2025-07-18T12:00:00Z"
      }'

The service will forward this payload into the configured Elasticsearch index.


🛠️ Built With


🔐 Security Notes

  • Always secure your .env file and sensitive environment variables.
  • Consider using Docker Secrets or environment variable injection via your CI/CD platform in production.

Tag summary

Content type

Image

Digest

sha256:d64fa930d

Size

69.5 MB

Last updated

3 months ago

docker pull nishadangre/elasticsearch-webhook