title: How to run ad hoc docker compose commands in Ansible?
body: <p>I have to run several <code>docker-compose run</code> commands for my Phoenix web app project. From the terminal I have to run this:</p>
  
  <p><code>$ sudo docker-compose run web mix do deps.get, compile</code></p>
  
  <p><code>$ sudo docker-compose run web mix ecto.create</code></p>
  
  <p><code>$ sudo docker-compose run web mix ecto.migrate</code></p>
  
  <p>While this works fine, I would like to automate it using Ansible. I'm well aware there is the <strong>docker_service</strong> Ansible module that consumes the docker-compose API and I'm also aware of the <code>definition</code> option that makes it easy to covert integrate the configuration inside docker-compose.yml into my playbook. 
  What I don't know is how do I ensure that the commands above will be run before starting the containers. Can anyone help me with this issue?</p>