2015-06-02 12:47:33 +00:00
|
|
|
[Unit]
|
|
|
|
Description=resin-supervisor-dind
|
2015-09-25 14:20:36 +00:00
|
|
|
Requires=confd.service docker.service openvpn-resin.service
|
2015-06-02 12:47:33 +00:00
|
|
|
After=confd.service
|
2015-09-25 14:20:36 +00:00
|
|
|
Before=openvpn-resin.service
|
2015-06-02 12:47:33 +00:00
|
|
|
|
|
|
|
[Service]
|
|
|
|
WorkingDirectory=/usr/src/app
|
|
|
|
EnvironmentFile=/usr/src/app/config/env
|
2015-09-02 19:19:24 +00:00
|
|
|
EnvironmentFile=/usr/src/app/config/localenv
|
2017-07-26 17:44:09 +00:00
|
|
|
ExecStartPre=/bin/bash -c 'if [ "${PRELOADED_IMAGE}" == "true" ]; then /usr/bin/docker pull $(jq --raw-output ".[0].imageId" ${APPS_PATH}); fi'
|
2017-07-10 16:37:36 +00:00
|
|
|
ExecStartPre=/usr/bin/docker load --input /usr/src/supervisor-image.tar
|
2015-06-02 12:47:33 +00:00
|
|
|
ExecStartPre=-/usr/bin/docker kill resin_supervisor
|
|
|
|
ExecStartPre=-/usr/bin/docker rm resin_supervisor
|
|
|
|
ExecStartPre=-/bin/touch /etc/resolv.conf
|
2015-09-07 19:51:00 +00:00
|
|
|
ExecStart=/bin/bash -c 'source /usr/src/app/resin-vars && \
|
|
|
|
/usr/bin/docker run --rm --privileged --name resin_supervisor \
|
2015-06-02 12:47:33 +00:00
|
|
|
--net=host \
|
2016-10-26 11:43:13 +00:00
|
|
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
2015-06-02 12:47:33 +00:00
|
|
|
-v "${CONFIG_PATH}:/boot/config.json" \
|
2015-09-02 19:19:24 +00:00
|
|
|
-v "${APPS_PATH}:/boot/apps.json" \
|
2015-06-02 12:47:33 +00:00
|
|
|
-v /resin-data/resin-supervisor:/data \
|
|
|
|
-v /proc/net/fib_trie:/mnt/fib_trie \
|
|
|
|
-v /var/log/supervisor-log:/var/log \
|
|
|
|
-v /:/mnt/root \
|
2015-07-21 22:09:59 +00:00
|
|
|
-v /etc/resolv.conf:/etc/resolv.conf:rw \
|
2016-07-05 17:48:14 +00:00
|
|
|
${SUPERVISOR_EXTRA_MOUNTS} \
|
2015-09-07 19:51:00 +00:00
|
|
|
-e "API_ENDPOINT=$API_ENDPOINT" \
|
2017-06-27 00:17:25 +00:00
|
|
|
-e "DELTA_ENDPOINT=$DELTA_ENDPOINT" \
|
2015-09-07 19:51:00 +00:00
|
|
|
-e "REGISTRY_ENDPOINT=$REGISTRY_ENDPOINT" \
|
|
|
|
-e "PUBNUB_SUBSCRIBE_KEY=$PUBNUB_SUBSCRIBE_KEY" \
|
|
|
|
-e "PUBNUB_PUBLISH_KEY=$PUBNUB_PUBLISH_KEY" \
|
|
|
|
-e "MIXPANEL_TOKEN=$MIXPANEL_TOKEN" \
|
2015-06-02 12:47:33 +00:00
|
|
|
-e "LED_FILE=${LED_FILE}" \
|
2015-09-07 19:51:00 +00:00
|
|
|
-e "LISTEN_PORT=$LISTEN_PORT" \
|
2015-06-02 12:47:33 +00:00
|
|
|
-e "SUPERVISOR_IMAGE=${SUPERVISOR_IMAGE}" \
|
2015-07-28 21:10:17 +00:00
|
|
|
-e "RESIN_SUPERVISOR_SECRET=${RESIN_SUPERVISOR_SECRET}" \
|
2016-06-21 17:01:31 +00:00
|
|
|
-e "DOCKER_ROOT=/mnt/root/var/lib/docker" \
|
2016-10-26 11:43:13 +00:00
|
|
|
-e "DOCKER_SOCKET=/var/run/docker.sock" \
|
2015-09-07 19:51:00 +00:00
|
|
|
${SUPERVISOR_IMAGE}'
|
2015-06-02 12:47:33 +00:00
|
|
|
TimeoutStartSec=0
|
|
|
|
Restart=always
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=basic.target
|