react-native-dockerized/entrypoint.sh

21 lines
449 B
Bash
Executable File

#!/bin/bash
set -e
# Check if GH_TOKEN exists
if [[ -n $GH_TOKEN ]]; then
# Github auth for private npm packages
su -c "echo \"//github.com/:_authToken=$GH_TOKEN\" > /home/app/.npmrc"
fi
# install npm dependencies
su -c "cd /home/app && npm install"
# If GH_TOKEN exists, remove the token
if [[ -n $GH_TOKEN ]]; then
su -c "rm -f /home/app/.npmrc"
fi
# run supervisord
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf