#!/bin/sh
set -e

# Print env infos
echo "APP_ENV=${APP_ENV}";
echo "APP_RUNTIME_ENV=${APP_RUNTIME_ENV}";
echo "APP_DEBUG=${APP_DEBUG}";

/app/bin/console lexik:jwt:generate-keypair --skip-if-exists

# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
	set -- php-fpm "$@"
fi

exec "$@"
