Skip to content
Snippets Groups Projects
haproxy.service 506 B
Newer Older
pierreozoux's avatar
pierreozoux committed
[Unit]
Description=%p
Pierre Ozoux's avatar
Pierre Ozoux committed

# Requirements
pierreozoux's avatar
pierreozoux committed
Requires=docker.service

Pierre Ozoux's avatar
Pierre Ozoux committed
# Dependency ordering
After=docker.service

pierreozoux's avatar
pierreozoux committed
[Service]
Restart=always
Pierre Ozoux's avatar
Pierre Ozoux committed
RestartSec=20
TimeoutStartSec=0
Pierre Ozoux's avatar
Pierre Ozoux committed
ExecStartPre=-/usr/bin/docker kill %p
ExecStartPre=-/usr/bin/docker rm %p
Pierre Ozoux's avatar
Pierre Ozoux committed
ExecStart=/usr/bin/docker run \
Pierre Ozoux's avatar
Pierre Ozoux committed
  --rm \
Pierre Ozoux's avatar
Pierre Ozoux committed
  --name %p \
Pierre Ozoux's avatar
Pierre Ozoux committed
  -v /dev/log:/dev/log \
  -v /data/runtime/haproxy:/etc/haproxy \
Pierre Ozoux's avatar
Pierre Ozoux committed
  -p 80:80 \
  -p 443:443 \
Pierre Ozoux's avatar
Pierre Ozoux committed
  haproxy haproxy -f /etc/haproxy/haproxy.cfg
pierreozoux's avatar
pierreozoux committed
ExecReload=/usr/bin/docker restart %p
Pierre Ozoux's avatar
Pierre Ozoux committed
ExecStop=/usr/bin/docker stop %p
pierreozoux's avatar
pierreozoux committed