bokysan / docker-postfix

Multi architecture simple SMTP server (postfix null relay) host for your Docker and Kubernetes containers. Based on Debian/Ubuntu/Alpine.
MIT License
555 stars 152 forks source link

prometheus without k8s #193

Closed llaumgui closed 7 months ago

llaumgui commented 7 months ago

Hi,

it would be fine to can enable prometheus feature without using k8s (docker-compose).

Best regards.

bokysan commented 7 months ago

Hi.

Prometheus is implemented as a sidecar container. In other words: it runs a separate docker image which consumes the logs from Postfix itself.

This is technically not feasible to do inside a single image, without building and pulling in the whole kumina/postfix_exporter image.

You can, however, implement it yourself by running a second container inside docker-compose.yaml, based on the example in the chart. There are some tweaks as you need to:

With all of that, there's no simple and elegant solution to do this completely copy-paste generic.

I am willing, however, to pull your docker-compose.yaml in into examples should you find a configuration that works.