
- hosts: hosts
  vars:
    thumby_port: 15001
    datadog_api_key: "your api key here"
    datadog_app_key: "your app key here"

  tasks:
    - name: clone git repository
      git: repo=https://github.com/mopsalarm/thumby.git dest=/tmp/thumby update=yes

    - name: build docker image
      command: docker build -t pr0gramm/thumby /tmp/thumby

    - name: remove previous container
      docker: name=pr0gramm-thumby image=pr0gramm/thumby state=absent

    - name: start new docker container
      docker:
        name: pr0gramm-thumby
        image: pr0gramm/thumby
        state: started

        env:
          DATADOG_API_KEY: "{{ datadog_api_key }}"
          DATADOG_APP_KEY: "{{ datadog_app_key }}"

        ports:
          - "0.0.0.0:{{ thumby_port }}:5000"


- hosts: hosts
  vars:
    thumby_port: 15001
    datadog_api_key: "your api key here"
    datadog_app_key: "your app key here"
    docker_image: mopsalarm/pr0gramm-thumby

  tasks:
    - name: remove previous container
      docker: name=pr0gramm-thumby image={{ docker_image }} state=absent

    - name: start new docker container
      docker:
        name: pr0gramm-thumby
        image: "{{ docker_image }}"
        state: started
        pull: always

        env:
          DATADOG_API_KEY: "{{ datadog_api_key }}"
          DATADOG_APP_KEY: "{{ datadog_app_key }}"

        ports:
          - "0.0.0.0:{{ thumby_port }}:5000"

Move thumby to official docker registry
Move thumby to official docker registry
