<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Levin Alexander on Medium]]></title>
        <description><![CDATA[Stories by Levin Alexander on Medium]]></description>
        <link>https://medium.com/@levinalex?source=rss-25a17e73d27d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*D_uC2gKM3DjQTQ3C.png</url>
            <title>Stories by Levin Alexander on Medium</title>
            <link>https://medium.com/@levinalex?source=rss-25a17e73d27d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 03:30:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@levinalex/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Run Orthanc Dicom Server on Synology with Docker]]></title>
            <link>https://medium.com/@levinalex/run-orthanc-on-synology-with-docker-4541e8898092?source=rss-25a17e73d27d------2</link>
            <guid isPermaLink="false">https://medium.com/p/4541e8898092</guid>
            <category><![CDATA[orthanc]]></category>
            <category><![CDATA[pac]]></category>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Levin Alexander]]></dc:creator>
            <pubDate>Tue, 09 May 2017 18:27:36 GMT</pubDate>
            <atom:updated>2017-05-09T18:28:15.242Z</atom:updated>
            <content:encoded><![CDATA[<p>I have published an <a href="https://github.com/levinalex/orthanc-synology-ansible-example">example ansible playbook</a> to run the <a href="http://www.orthanc-server.com/">fantastic Orthanc DICOM server</a> on a Synology DiskStation with Docker.</p><p>The playbooks are on github at <a href="https://github.com/levinalex/orthanc-synology-ansible-example">github.com/levinalex/orthanc-synology-ansible-example</a>.</p><h3>Prerequisites</h3><ul><li><a href="http://docs.ansible.com/ansible/">ansible</a> (I am using ansible version 2.3.0, installed with pip)</li><li>a Synology NAS <a href="https://www.synology.com/en-us/dsm/app_packages/Docker">that can run Docker</a> (I am running this on a DS 1813+)</li></ul><p>On your DiskStation, you need to create a user ansible with a strong password and enable SSH. (Terminal &amp; SNMP in Control Panel). Add that password and the IP address of your DiskStation to the hosts file.</p><p>After that, ansible should be able to connect to your NAS. You can verify with ansible synology -m ping.</p><p>Before running the playbook, you need to change the default passwords:</p><ul><li>Edit site.yml to add your SSH public key and to set a strong password for your database.</li><li>Edit synology-orthanc/templates/orthanc.json.j2 to configure Orthanc. You should change the default password for the web interface.</li></ul><p>Running ansible-playbook with ansible-playbook site.yml should install and run Orthanc on your NAS. You should be able to connect via <a href="http://your_synology_ip:8042.">http://your_synology_ip:8042.</a></p><h3>Overview of the playbook</h3><h4>Synology Preparation</h4><p>The first thing this playbook does is enable SSH key based authentication on the Synology. (using the key given in site.yml)</p><pre>- name: Enable SSH Key Login for &#39;ansible&#39; User<br>  become: yes<br>  authorized_key:<br>    user: ansible<br>    key: &#39;{{ synology_ansible_ssh_key }}&#39;</pre><p>Then, because the <a href="https://docs.ansible.com/ansible/docker_container_module.html">docker_container ansible module</a> needs the docker-py python package, the playbook installs pip:</p><pre>- name: check for pip<br>  shell: which pip<br>  changed_when: false<br>  failed_when: false<br>  register: pip_installed</pre><pre>- name: Download pip installer<br>  become: yes<br>  get_url:<br>    url: <a href="https://bootstrap.pypa.io/get-pip.py">https://bootstrap.pypa.io/get-pip.py</a><br>    dest: /tmp/get-pip.py<br>  when: pip_installed.rc != 0</pre><pre>- name: Install pip<br>  become: yes<br>  command: python /tmp/get-pip.py<br>  when: pip_installed.rc != 0</pre><pre>- name: Install pip dependencies<br>  become: yes<br>  pip: name={{ item }}<br>  with_items:<br>    - docker-py</pre><h4>Create Directories</h4><p>The next steps create the necessary directories. The postgres data directory expects special permissions:</p><pre>- name: Create orthanc directories<br>  become: yes<br>  file:<br>    path: &quot;{{ item }}&quot;<br>    state: directory<br>    owner: ansible<br>    mode: 0755<br>  with_items:<br>    - &#39;{{ orthanc_basedir }}&#39;<br>    - &#39;{{ orthanc_basedir }}/conf&#39;<br>    - &#39;{{ orthanc_basedir }}/storage&#39;<br>    - &#39;{{ orthanc_basedir }}/index&#39;</pre><pre>- name: Create orthanc database directory<br>  become: yes<br>  file:<br>    path: &#39;{{ orthanc_basedir }}/db&#39;<br>    owner: 999<br>    group: 999<br>    state: directory<br>    mode: 0700</pre><h4>Upload Orthanc Configuration</h4><p>The orthanc configuration (synology-orthanc/templates/orthanc.json.j2) has the PostgreSQL plugin enabled and the postgres server host is set to the postgres container.</p><p>If you have lua scripts, put them in synology-orthanc/files/lua-scripts/ and add them to the configuration.</p><pre>{<br>  &quot;PostgreSQL&quot; : {<br>    &quot;EnableIndex&quot; : true,<br>    &quot;EnableStorage&quot; : false,<br>    &quot;Host&quot; : &quot;{{ orthanc_name }}-postgres&quot;,<br>    &quot;Port&quot; : 5432,<br>    &quot;Database&quot; : &quot;orthanc&quot;,<br>    &quot;Username&quot; : &quot;orthanc&quot;,<br>    &quot;Password&quot; : &quot;{{ orthanc_pg_password }}&quot;<br>  }<br>}</pre><p>The configuration file is uploaded with these ansible steps:</p><pre>- name: Upload Orthanc configuration<br>  template: src=orthanc.json.j2 dest={{ orthanc_basedir }}/conf/orthanc.json</pre><pre>- name: Upload orthanc scripts<br>  synchronize:<br>    src: orthanc-scripts/<br>    dest: &#39;{{ orthanc_basedir }}/conf/scripts/&#39;<br>    recursive: yes<br>    rsync_path: &quot;rsync&quot;<br>    delete: yes<br>  notify:<br>  -  Restart orthanc docker container</pre><h4>Start Postgres and Orthanc Docker Images</h4><p>Now postgres and Orthanc can be started:</p><pre>- name: Start docker container orthanc-postgres<br>  become: yes<br>  docker_container:<br>    name: &#39;orthanc-postgres&#39;<br>    image: &#39;postgres:9.6.2&#39;<br>    restart_policy: always<br>    env:<br>      TZ: UTC<br>      PGDATA: /var/lib/postgresql/data/pgdata<br>      POSTGRES_USER: orthanc<br>      POSTGRES_PASSWORD: &#39;password&#39;<br>    volumes:<br>      - &#39;{{ orthanc_basedir}}/db:/var/lib/postgresql/data/pgdata&#39;</pre><pre>- name: Orthanc docker container orthanc<br>  become: yes<br>  docker_container:<br>    name: &#39;orthanc&#39;<br>    image: jodogne/orthanc-plugins:1.2.0<br>    command: &#39;/etc/orthanc&#39;<br>    restart_policy: always<br>    ports:<br>      - &#39;4242:4242&#39;<br>      - &#39;8042:8042&#39;<br>    links:<br>      - &#39;orthanc-postgres:orthanc-postgres&#39;<br>    volumes:<br>      - &#39;{{ orthanc_basedir }}/storage:/var/lib/orthanc/storage&#39;<br>      - &#39;{{ orthanc_basedir }}/index:/var/lib/orthanc/index&#39;<br>      - &#39;{{ orthanc_basedir }}/conf/orthanc.json:/etc/orthanc/orthanc.json:ro&#39;<br>      - &#39;{{ orthanc_basedir }}/conf/scripts:/etc/orthanc/scripts:ro&#39;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4541e8898092" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>