-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathiri.service.j2
46 lines (43 loc) · 1.51 KB
/
iri.service.j2
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
42
43
44
45
46
[Unit]
Description=IRI
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
Restart=always
EnvironmentFile=-{{ config_dir }}/iri
SuccessExitStatus={{ service_success_exit_status | default('143') }}
ExecStartPre=-/bin/bash -c "/usr/bin/docker rm %p || /bin/true"
ExecStart=/usr/bin/docker run \
--name %p \
--user {{ iri_uid.stdout }} \
--net={{ iri_net_name | default('host') }} \
--cap-drop=ALL \
-v {{ iri_configdir }}:/iri/conf:ro,Z \
-v {{ iri_workdir }}:/iri/data:Z \
-v /etc/localtime:/etc/localtime:ro,Z \
{% if iri_net_name is defined %}
--hostname iri \
-p ${API_PORT}:${API_PORT} \
-p ${NEIGHBORING_SOCKET_PORT}:${NEIGHBORING_SOCKET_PORT} \
-p ${ZMQ_BIND}:${ZMQ_PORT}:${ZMQ_PORT} \
-p 127.0.0.1:{{ iri_mgmt_api_port }}:{{ iri_mgmt_api_port }} \
{% endif %}
-e JAVA_MIN_MEMORY=${JAVA_MIN_MEMORY} \
-e JAVA_MAX_MEMORY=${JAVA_MAX_MEMORY} \
-e DOCKER_IRI_REMOTE_LIMIT_API=${DOCKER_IRI_REMOTE_LIMIT_API} \
-e DOCKER_IRI_MONITORING_API_PORT_ENABLE=${DOCKER_IRI_MONITORING_API_PORT_ENABLE} \
-e DOCKER_IRI_MONITORING_API_PORT_DESTINATION=${API_PORT} \
$DOCKER_OPTS \
${IRI_IMAGE}:${TAG} \
--neighbors "${IRI_NEIGHBORS}" \
--port ${API_PORT} \
--neighboring-socket-address ${NEIGHBORING_SOCKET_ADDRESS} \
--neighboring-socket-port ${NEIGHBORING_SOCKET_PORT} \
-c /iri/conf/iri.ini $OPTIONS{% if iri_testnet is defined and iri_testnet %} \
--testnet true
{% endif %}
ExecStop=/usr/bin/docker stop %p
ExecReload=/usr/bin/docker restart %p
[Install]
WantedBy=multi-user.target