#!/bin/bash -x

#
# For now, we still are root...
#
if [ -z ${PUID} ]
then
    PUID=1000
fi

if [ -z ${GUID} ]
then
    GUID=1000
fi

USERNAME=osmmosques

groupadd \
    -g ${GUID} \
    ${USERNAME}

useradd \
    -u ${PUID} \
    -g ${GUID} \
    -d ${APP_HOME} \
    ${USERNAME}

chown    ${USERNAME}:${USERNAME} ${APP_HOME}
chown -R ${USERNAME}:${USERNAME} ${APP_HOME}/app
chown    ${USERNAME}:${USERNAME} ${APP_DATA}

if [ -r ${APP_HOME}/app/META-INF/MANIFEST.MF ]
then
    MAIN_CLASS=$(grep Start-Class ${APP_HOME}/app/META-INF/MANIFEST.MF | sed -e 's|Start-Class: ||' | sed -e 's|\r||')
else
    MAIN_CLASS=com.gurkensalat.osm.mosques.Monolith
fi

env | sort

su ${USERNAME} -c "JAVA_HOME="${JAVA_HOME}" java ${JAVA_OPTS} -Dspring.profiles.active=${SPRING_PROFILES} -cp app:app/lib/* ${MAIN_CLASS}"

#!/bin/bash -x

#
# For now, we still are root...
#
if [ -z ${PUID} ]
then
    PUID=1000
fi

if [ -z ${GUID} ]
then
    GUID=1000
fi

USERNAME=osmmosques

groupadd \
    -g ${GUID} \
    ${USERNAME}

useradd \
    -u ${PUID} \
    -g ${GUID} \
    -d ${APP_HOME} \
    ${USERNAME}

chown    ${USERNAME}:${USERNAME} ${APP_HOME}
chown -R ${USERNAME}:${USERNAME} ${APP_HOME}/app
chown    ${USERNAME}:${USERNAME} ${APP_DATA}

if [ -r ${APP_HOME}/app/META-INF/MANIFEST.MF ]
then
    MAIN_CLASS=$(grep Start-Class ${APP_HOME}/app/META-INF/MANIFEST.MF | sed -e 's|Start-Class: ||' | sed -e 's|\r||')
else
    MAIN_CLASS=com.gurkensalat.osm.mosques.Monolith
fi

env | sort

su ${USERNAME} -c ${JAVA_HOME}"/bin/java ${JAVA_OPTS} -Dspring.profiles.active=${SPRING_PROFILES} -cp app:app/lib/* ${MAIN_CLASS}"

Use proper path for java interpreter
[docker] Use proper path for java interpreter

Signed-off-by: Hakan Tandogan <dc3e3f27cbce5d5b06adbb828e174692baf4e3da@tandogan.com>
