[go: up one dir, main page]

Skip to content

Deploying a server in a Docker container#

C++ Webhook server Library for integration with WhatsApp messenger via API of green-api.com service.

To run this project with Docker, you will need:

  1. The built C++ WhatsApp Webhook Server project on Windows or Linux
  2. Installed Docker Desktop for Windows or Docker Desktop for Linux.

Clone the repository:

git clone --branch=master --depth=1 https://github.com/green-api/whatsapp-api-webhook-server-cpp
cd whatsapp-api-webhook-server-cpp
Before running Docker you should create this file (or copy existing one if you have it):

  • source/user_adapter.cpp

If you don't have required file, create it by renaming with removing underscore from source/_user_adapter.cpp file.

We will update include/user_adapter.h and source/_user_adapter.cpp files as new webhooks are released. If you encountered build error, which tells compiler could not find required functions from user_adapter, please add new functions from source/_user_adapter.cpp to yours source/user_adapter.cpp

By default, port 5000is exposed. If you would like to change it, you need:

  • Change Address field in config.json to your desired port;

  • Change ports field in compose.yaml to your desired port;

Run Docker image with Docker Compose:

docker compose up --build whatsapp-api-webhook-server-cpp

Server will be started after building automatically. Detailed configuration description available here.

To test the server you can use Postman collection.

Video-instruction#