title: Copy files and create symlink from a shared volume on Docker on container start
body: <p>I have a container mounting a shared volume on run, and I need to copy some files from the location where this volume mounts to another and create a symlink.</p>
  
  <p>I tried several ways, and lastly I was using supervisor. So I created I simple bash script which cp and ln what I need from where the volume is mounted on the docker container to my final destination inside the docker container. But supervisor fails.</p>
  
  <p>This is my supervisor conf file:</p>
  
  <pre><code>[supervisord]
  nodaemon=true
  
  [program:nonversioned]
  command=/deploy.sh
  numprocs=1
  autostart=true
  autorestart=true
  exitcodes=1
  </code></pre>
  
  <p>This is an example of what it has my deploy.sh</p>
  
  <pre><code>#!/usr/bin/env bash
  
  # Copy config files
  cp -f /efs/deploys/wp-config.php /var/www/html
  
  # Softlink to uploads
  ln -s /efs/deploys/uploads /var/www/html/assets/uploads
  </code></pre>
  
  <p>In my Dockerfile also tried several things of launching supervisor. Lastly I was trying with:</p>
  
  <pre><code>CMD ["supervisord -n"]
  </code></pre>
  
  <p>But it says that supervisord is not in the path</p>
  
  <p>And I am starting my container with:</p>
  
  <pre><code>docker run -d 
          -v /home/user/my_efs:/efs \
          mytest/testing
  </code></pre>