title: docker-compose deployment ensure container is installed on specific server
body: <p>I have the following in my compose file:</p>
  
  <pre><code>  postgres:
      deploy:
        mode: global
        placement:
          constraints:
            - node.labels.server == data
  </code></pre>
  
  <p>And my node has the following when I inspect it:</p>
  
  <pre><code>"Spec": {
      "Labels": {
          "server": "data"
      },
      "Role": "worker",
      "Availability": "active"
  },
  </code></pre>
  
  <p>However, when i deploy my stack postgres doesn't install anywhere... </p>
  
  <p>What am I missing?</p>
  
  <p>[UPDATE]</p>
  
  <p>This is in the docker-compose.prod.yml btw in case you're wondering where the rest of the config is</p>
  
  <p>[UPDATE]</p>
  
  <p>This is running my compose as a stack across multiple servers. Using this command to fire it off:</p>
  
  <pre><code>docker stack deploy --compose-file docker-compose.yml --compose-file docker-compose.prod.yml stackname--with-registry-auth
  </code></pre>
  
  <p>Here is the output of ps:</p>
  
  <pre><code>root@sonatribe-1:~# docker service ps postgres --no-trunc
  ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE       ERROR               PORTS
  </code></pre>
  
  <p>Elsewhere on other services I have stuff like this to ensure certain stuff is run on a manager node:</p>
  
  <pre><code>deploy:
    mode: global
    placement:
      constraints:
        - node.role == manager
  </code></pre>
  
  <p>And that works fine - it's only the one using:</p>
  
  <pre><code>node.labels.server == data
  </code></pre>
  
  <p>That doesn't work</p>