title: how to set supervisor to run a shell script
body: <p>Setting up a <code>Dockerfile</code> to install node prereqs and then set up supervisor in order to run the final <code>npm install</code> command. Running Docker in CoreOS under VirtualBox.</p>
  
  <p>I have a <code>Dockerfile</code> that sets everything up correctly:</p>
  
  <pre><code>FROM ubuntu
  MAINTAINER &lt;&lt;Me&gt;&gt;
  
  # Install docker basics
  RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" &gt; /etc/apt/sources.list
  RUN apt-get update
  RUN apt-get upgrade -y
  
  # Install dependencies and nodejs
  RUN apt-get update
  RUN apt-get install -y python-software-properties python g++ make
  RUN add-apt-repository ppa:chris-lea/node.js
  RUN apt-get update
  RUN apt-get install -y nodejs
  
  # Install git
  RUN apt-get install -y git
  
  # Install supervisor
  RUN apt-get install -y supervisor
  RUN mkdir -p /var/log/supervisor
  
  # Add supervisor config file
  ADD ./etc/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
  
  # Bundle app source
  ADD . /src
  
  # create supervisord user
  RUN /usr/sbin/useradd --create-home --home-dir /usr/local/nonroot --shell /bin/bash nonroot
  RUN chown -R nonroot: /src
  
  # set install script to executable
  RUN /bin/chmod +x /src/etc/install.sh
  
  #set up .env file
  RUN echo "NODE_ENV=development\nPORT=5000\nRIAK_SERVERS={SERVER}" &gt; /src/.env
  
  #expose the correct port
  EXPOSE 5000
  
  # start supervisord when container launches
  CMD ["/usr/bin/supervisord"]
  </code></pre>
  
  <p>And then I want to set up supervisord to launch one of a few possible processes, including an installation shell script that I've confirmed to work correctly, <code>install.sh</code>, which is located in the application's <code>/etc</code> directory:</p>
  
  <pre><code>#!/bin/bash
  cd /src; npm install
  export PATH=$PATH:node_modules/.bin
  </code></pre>
  
  <p>However, I'm very new to supervisor syntax, and I can't get it to launch the shell script correctly. This is what I have in my <code>supervisord.conf</code> file:</p>
  
  <pre><code>[supervisord]
  nodaemon=true
  
  [program:install]
  command=install.sh
  directory=/src/etc/
  user=nonroot
  </code></pre>
  
  <p>When I run the <code>Dockerfile</code>, everything runs correctly, but when I launch the image, I get the following:</p>
  
  <pre><code>2014-03-15 07:39:56,854 CRIT Supervisor running as root (no user in config file)
  2014-03-15 07:39:56,856 WARN Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
  2014-03-15 07:39:56,913 INFO RPC interface 'supervisor' initialized
  2014-03-15 07:39:56,913 WARN cElementTree not installed, using slower XML parser for XML-RPC
  2014-03-15 07:39:56,914 CRIT Server 'unix_http_server' running without any HTTP authentication checking
  2014-03-15 07:39:56,915 INFO supervisord started with pid 1
  2014-03-15 07:39:57,918 INFO spawnerr: can't find command 'install.sh'
  2014-03-15 07:39:58,920 INFO spawnerr: can't find command 'install.sh'
  </code></pre>
  
  <p>Clearly, I have not set up supervisor correctly to run this shell script -- is there part of the syntax that I'm screwing up?</p>