#cloud-config

hostname: hither

coreos:
  update:
    reboot-strategy: best-effort

  units:
    - name: hither.service
      command: start
      content: |
        [Unit]
        Description=Hither container
        After=docker.service

        [Service]
        Restart=always
        ExecStart=/home/core/run-hither
        ExecStop=/usr/bin/docker stop -t 5 hither

        [Install]
        WantedBy=local.target

write_files:
  - path: /opt/hither/run-hither
    permissions: 0755
    content: |
      #!/bin/bash
      /usr/bin/docker start -a hither || /usr/bin/docker run --env-file=/opt/hither/env -p 80:9000 -v /opt/hither/localRegistry:/opt/hither/localRegistry --name hither wiredthing/hither:latest

  - path: /opt/hither/env
    permissions: 0755
    content: |
      registry.index=/opt/hither/localRegistry/index
      registry.root=/opt/hither/localRegistry/registry
      registry.cache.root=/opt/hither/localRegistry/cache
#cloud-config

hostname: hither

coreos:
  update:
    reboot-strategy: best-effort

  units:
    - name: hither.service
      command: start
      content: |
        [Unit]
        Description=Hither container
        After=docker.service

        [Service]
        Restart=always
        ExecStart=/home/core/run-hither
        ExecStop=/usr/bin/docker stop -t 5 hither

        [Install]
        WantedBy=local.target

write_files:
  - path: /opt/hither/run-hither
    permissions: 0755
    content: |
      #!/bin/bash
      /usr/bin/docker start -a hither || /usr/bin/docker run --env-file=/opt/hither/env -p 80:9000 -v /opt/hither/localRegistry:/opt/hither/localRegistry --name hither wiredthing/hither:latest

  - path: /opt/hither/env
    permissions: 0755
    content: |
      registry.index=/opt/hither/localRegistry/index
      registry.root=/opt/hither/localRegistry/registry
      registry.cache.root=/opt/hither/localRegistry/cache
      pidfile.path=/dev/null

Set the pidfile.path to /dev/null to stop Play from writing the pidfile. This will ensure that if play crashes and systemd restarts it it won’t fail due to the PIDFILE being left behind.
Set the pidfile.path to /dev/null to stop Play from writing the pidfile. This will ensure that if play crashes and systemd restarts it it won’t fail due to the PIDFILE being left behind.
