init 450 B

123456789101112131415161718192021
  1. #!/bin/bash
  2. set -e
  3. cd /app
  4. # Cleanup any leftover pid file
  5. if [ -f /app/tmp/pids/server.pid ]; then
  6. rm /app/tmp/pids/server.pid
  7. fi
  8. source /scripts/setup_env
  9. # Fixup the Procfile and prepare the PORT
  10. if [ -n "${DO_NOT_RUN_JOBS}" ]; then
  11. sed -i -e 's/^jobs:/#jobs:/' /app/Procfile
  12. fi
  13. sed -i -e "s/\${IP-0.0.0.0}/$IP/" -e "s/\${PORT-3000}/$PORT/" /app/Procfile
  14. # start supervisord
  15. exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf