bitnami-containers/bitnami/codeigniter/3/debian-9/rootfs/app-entrypoint.sh

35 lines
909 B
Bash
Executable File

#!/bin/bash -e
. /opt/bitnami/base/functions
. /opt/bitnami/base/helpers
print_welcome_page
if [[ "$1" == "nami" && "$2" == "start" ]] || [[ "$1" == "php" ]]; then
#!/bin/bash
PROJECT_DIRECTORY=/app/$CODEIGNITER_PROJECT_NAME
DEPLOY=("$@")
echo "Starting application ..."
if [[ "$1" = "php" && "$2" = "-S" ]]; then
if [[ ! -d "$PROJECT_DIRECTORY" ]]; then
log "Creating example Codeigniter application"
nami execute codeigniter createProject --databaseServerHost "$MARIADB_HOST" --databaseServerPort "$MARIADB_PORT_NUMBER" --databaseAdminUser "$MARIADB_USER" "$CODEIGNITER_PROJECT_NAME" | grep -v undefined
log "Codeigniter app created"
else
log "App already created"
cd "$PROJECT_DIRECTORY"
fi
DEPLOY=("$@" "-t" "$PROJECT_DIRECTORY")
fi
exec tini -- "${DEPLOY[@]}"
nami_initialize php
info "Starting codeigniter... "
fi
exec tini -- "$@"