[Unit]
Description=marathon-lb
After=docker.service
Requires=docker.service

[Service]
ExecStartPre=-/usr/bin/docker kill marathon-lb
ExecStartPre=-/usr/bin/docker rm marathon-lb
EnvironmentFile=/etc/sysconfig/marathon-lb
ExecStart=/usr/bin/docker run --name marathon-lb \
	--privileged \
	--net=host \
	-e PORTS=9090 \
	robbrockbank/marathon-lb:assign-service-ports sse --marathon http://${MARATHON_IP}:8080 --group external \
        --min-serv-port-ip-per-task 20001 --max-serv-port-ip-per-task 29999

[Install]
WantedBy=multi-user.target
