Categories
Containerisation Containers Docker

Deploying Praeco on Portainer

In this post I’m going to attempt to setup Praeco on Portainer.Praeco is a frontend for setting up Elastalert rules that check an elasticsearch index and send automated messages via telegram, slack or webhook.

To set this up you need 2 things already setup:

  • Elasticsearch instance
  • Portainer Instance

You also should know a bit about docker and docker-compose.yml.

praeco-alertselasticsearch-praeco-portainer

 

 

 

 

 

 

 

Things should Be Easy

In theory or in development, you set an environment variable and then docker-compose up -d and everything just works. When deploying to a production system that doesn’t work as good.

I tried to create an AppTemplate, portainer would say it worked but it was not shown in the list.

So I tried to create a stack, go to stacks -> add stack. I add the required fields and set the repo url as: https://github.com/ServerCentral/praeco

portainer-praeco-stack-create

I created the stack and booom – I thought it just worked!

Unfortunately when I view the stack I see a very different picture:

portainer-praeco-deploy-rejected

The error message on one of the tasks for praeco_webapp is Invalid mount config for type "bind": bind source path does not exist: /data/compose/3/public/praeco.config.json

The error on praeco_elastalert is Invalid mount config for type "bind": bind source path does not exist: /data/compose/3/config/elastalert.yaml

So it expects these files to exist on the host file system.

Bind mounts…what do I do now

This system is not your dev machine, where you pull the git repo and then make config and rule changes and then get the docker instances up. This system pretty much only uses your docker compose to build the images and fails because the repo doesn’t actually exists on the host nodes.

Since it is doing a bind mount – that is not something you want to do in a production system.

Damn…I’m stuck