-
Notifications
You must be signed in to change notification settings - Fork 15
41 lines (37 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
[Unit]
Description=Consul
After=docker.service
Requires=docker.service
[Service]
EnvironmentFile=/etc/environment
TimeoutStartSec=0
ExecStartPre=/usr/bin/mkdir -p /var/lib/consul /etc/consul
ExecStartPre=/usr/bin/chmod a+rw /var/lib/consul /etc/consul
ExecStartPre=-/usr/bin/docker kill consul
ExecStartPre=-/usr/bin/docker rm consul
ExecStartPre=/usr/bin/docker pull pingles/consul-coreos:latest
ExecStart=/bin/bash -c '/usr/bin/docker run \
--name consul \
-v /var/lib/consul:/data \
-v /etc/consul:/config \
-p ${COREOS_PRIVATE_IPV4}:8300:8300 \
-p ${COREOS_PRIVATE_IPV4}:8301:8301 \
-p ${COREOS_PRIVATE_IPV4}:8301:8301/udp \
-p ${COREOS_PRIVATE_IPV4}:8302:8302 \
-p ${COREOS_PRIVATE_IPV4}:8302:8302/udp \
-p ${COREOS_PRIVATE_IPV4}:8400:8400 \
-p ${COREOS_PRIVATE_IPV4}:8500:8500 \
-p ${COREOS_PRIVATE_IPV4}:8600:8600 \
-p ${COREOS_PRIVATE_IPV4}:8600:8600/udp \
--rm \
pingles/consul-coreos:latest \
-server \
-atlas-join \
-atlas=ATLAS_USERNAME/infrastructure \
-atlas-token=ATLAS_TOKEN \
-node=%m \
-bootstrap-expect=3 \
-advertise=${COREOS_PRIVATE_IPV4}'
ExecStop=-/usr/bin/docker stop consul
[X-Fleet]
Conflicts=consul*