docker-compose run service-name command
If, for example, you wanted to run rake db:create in your web service, you'd use the following command:
rake db:create
web
docker-compose run web rake db:create