gts-x / docker /init.sh
JAMES HAN
Initial commit — GTS Modern subtitle converter
dff41a8
Raw
History Blame Contribute Delete
476 Bytes
#!/bin/sh
set -e
sed -i "s#__ENV__#$APP_ENV#" /etc/cwagentconfig/amazon-cloudwatch-agent.json
/opt/aws/amazon-cloudwatch-agent/bin/start-amazon-cloudwatch-agent &
if [ $? -ne 0 ]; then
echo "Error: could not start cloudwatch agent"
exit 1
fi
if [ -n "$SECRETS" ]; then
echo "${SECRETS}" | jq -r 'to_entries[] | "\(.key)=\(.value)"' > /app/.env
export $(cat /app/.env | xargs)
unset SECRETS
fi
echo "Running database migrations..."
npm run db:migrate
exec "$@"