d80f4a93ab
Haproxy wants to log to syslog (and not stdout for performance reasons, see https://github.com/dockerfile/haproxy/issues/3). However there is no running syslog in our haproxy container. What we can do is mount in the host's /dev/log and have haproxy write to the hosts syslog to get logging. Do this via a docker compose volume bind mount. Change-Id: Icf4a91c2bc5f5dbb0bfb9d36e7ec0210c6dc4e90
23 lines
556 B
YAML
23 lines
556 B
YAML
# Version 2 is the latest that is supported by docker-compose in
|
|
# Ubuntu Xenial.
|
|
version: '2'
|
|
|
|
services:
|
|
haproxy:
|
|
restart: always
|
|
image: haproxy:latest
|
|
network_mode: host
|
|
volumes:
|
|
- /dev/log:/dev/log
|
|
- /var/haproxy/etc:/usr/local/etc/haproxy
|
|
- /var/haproxy/run:/var/haproxy/run
|
|
haproxy-statsd:
|
|
restart: always
|
|
image: opendevorg/haproxy-statsd:latest
|
|
network_mode: host
|
|
volumes:
|
|
- /var/haproxy/run:/var/haproxy/run
|
|
environment:
|
|
STATSD_HOST: graphite.opendev.org
|
|
STATSD_PORT: 8125
|