title: Referencing services with Docker Compose
body: <p>I'm having issues calling what is supposed to have been defined in some Docker Compose services from my "main" (<code>web</code>) service. I have the following <code>docker-compose.yml</code> file:</p>
  
  <pre><code>version: '2'
  
  services:
   db:
     image: postgres
     volumes:
      - postgres-db-volume:/data/postgres
   pdftk:
     image: mnuessler/pdftk
     volumes:
      - /tmp/manager:/work
   ffmpeg:
     image: jrottenberg/ffmpeg
     volumes:
      - /tmp/manager:/files
   web:
     build: .
     command: python manage.py runserver 0.0.0.0:8000
     volumes:
       - .:/code
       - /tmp/manager:/files
     ports:
       - "8000:8000"
     depends_on:
       - db
       - pdftk
       - ffmpeg
  
  volumes:
     postgres-db-volume:
  </code></pre>
  
  <p>I'm able to use <code>db</code> from <code>web</code> perfectly, but unfortunately not <code>pdftk</code> or <code>ffmpeg</code> (these are just command-line utilities that are undefined when I run <code>web</code>'s shell):</p>
  
  <pre><code>manager$ docker-compose run web bash
  Starting manager_ffmpeg_1
  Starting manager_pdftk_1
  root@16e4b755172d:/code# pdftk
  bash: pdftk: command not found
  root@16e4b755172d:/code# ffmpeg
  bash: ffmpeg: command not found
  </code></pre>
  
  <p>How can I get <code>pdftk</code> and <code>ffmpeg</code> to be defined within the <code>web</code> service? Is <code>depends_on</code> not the appropriate directive? Should I be extending <code>web</code>'s Dockerfile to call an entry-point script that installs the content found in the other two services (even though this'd seem counterproductive)?</p>
  
  <p>Tried to remove and rebuild the <code>web</code> service after adding <code>pdftk</code> and <code>ffmpeg</code>, but that didn't solve it.</p>
  
  <p>What can I do?</p>
  
  <p>Thank you!</p>