title: How do i run a shell script inside docker-compose
body: <p>I have a use case in which i am trying to build a django based rest api and then use continuous integration using travis CI when changes are pushed to github. I am also using docker to build and docker-compose to scale my services. The problem is i want to run pytest and flake8 when i push my changes to github. Now i have not added any tests and hence the pytest command is giving an exit status of 5.</p>
  
  <p>To get around this i tried creating a script to do this :</p>
  
  <pre><code>#!/bin/bash
  
  pytest;
  err=$? ;
  if (( $err != 5 )) ;
  then
    exit $err;
  fi
  flake8 ;
  </code></pre>
  
  <p>But i cannot get docker-compose to run this . When i run the script using the command : </p>
  
  <pre><code>docker-compose run app sh -c "run_script.sh"
  </code></pre>
  
  <p>It gives the below error message :
  sh: run_script.sh: not found</p>
  
  <p>Below is my docker-compose yml file:</p>
  
  <pre><code>version: "3"
  
  services:
    app:
      build:
        context: .
      ports:
        - "8000:8000"
      volumes:
        - ./app:/app
      command: &gt;
        sh -c "python manage.py runserver 0.0.0.0:8000"
  </code></pre>
  
  <p>And below is the dockerfile:</p>
  
  <pre><code>FROM python:3.7-alpine
  
  MAINTAINER Subhayan Bhattacharya
  
  ENV PYTHONUNBUFFERED 1
  
  COPY Pipfile* /tmp/
  
  RUN cd /tmp &amp;&amp; pip install pipenv &amp;&amp; pipenv lock --requirements &gt; requirements.txt
  
  RUN pip install -r /tmp/requirements.txt
  
  RUN mkdir /app
  
  WORKDIR /app
  
  COPY ./app /app
  
  RUN adduser -D user
  USER user
  </code></pre>
  
  <p>This should be a simple issue but i cannot figure out how to get around this.</p>
  
  <p>Can someone please help me find the solution</p>