title: Docker: docker compose file for "docker stack deploy"
body: <p>I have a <code>docker-compose.yml</code> file which works with <code>docker-compose up --build</code>. My app works and everything is fine.</p>
  
  <pre><code>version: '3'
  
  services:
  
    myapp:
      container_name: myapp
      restart: always
      build: ./myapp
      ports:
        - "8000:8000"
      command: /usr/local/bin/gunicorn -w 2 -b :8000 flaskplot:app
  
    nginx:
      container_name: nginx
      restart: always
      build: ./nginx
      ports:
        - "80:80"
      depends_on:
        - myapp
  </code></pre>
  
  <p>But when I use <code>docker stack deploy -c docker-compose.yml myapp</code>, I get the following error:</p>
  
  <pre><code>Ignoring unsupported options: build, restart
  
  Ignoring deprecated options:
  
  container_name: Setting the container name is not supported.
  
  Creating network myapp_default
  Creating service myapp_myapp
  failed to create service myapp_myapp: Error response from daemon: rpc error: code = InvalidArgument desc = ContainerSpec: image reference must be provided
  </code></pre>
  
  <p>any hints how I should "translate" the <code>docker-compose.yml</code> file to make it compatible with <code>docker stack deploy</code>?</p>