configure wildfly as a s6 service

This commit is contained in:
Sameer Naik
2015-10-02 14:58:13 +05:30
parent a223a2afbb
commit 9a999e8359
5 changed files with 40 additions and 33 deletions

View File

@@ -4,7 +4,8 @@ MAINTAINER Bitnami <containers@bitnami.com>
ENV BITNAMI_APP_DIR=$BITNAMI_PREFIX/wildfly \
BITNAMI_APP_NAME=wildfly \
BITNAMI_APP_USER=wildfly \
BITNAMI_APP_VERSION=9.0.1-0
BITNAMI_APP_VERSION=9.0.1-0 \
BITNAMI_APP_DAEMON=standalone.sh
ENV BITNAMI_APP_VOL_PREFIX=/bitnami/$BITNAMI_APP_NAME \
JAVA_HOME=$BITNAMI_PREFIX/java \
@@ -20,4 +21,3 @@ EXPOSE 8080 9990
VOLUME ["$BITNAMI_APP_VOL_PREFIX/conf", "$BITNAMI_APP_VOL_PREFIX/logs", "/app"]
ENTRYPOINT ["/entrypoint.sh"]
CMD ["standalone.sh"]

View File

@@ -1,36 +1,15 @@
#!/bin/bash
set -e
source $BITNAMI_PREFIX/bitnami-utils.sh
print_welcome_page
# if command starts with an option, prepend 'standalone.sh'
if [ "${1:0:1}" = '-' ]; then
EXTRA_OPTIONS="$@"
set -- standalone.sh
export EXTRA_OPTIONS="$@"
set --
elif [ "${1}" == "standalone.sh" -o "${1}" == "$(which standalone.sh)" ]; then
export EXTRA_OPTIONS="${@:2}"
set --
elif [ "${1}" == "domain.sh" -o "${1}" == "$(which domain.sh)" ]; then
export BITNAMI_APP_DAEMON=domain.sh
export EXTRA_OPTIONS="${@:2}"
set --
fi
if [ ! "$(ls -A $BITNAMI_APP_VOL_PREFIX/conf)" ]; then
generate_conf_files
if [ "$WILDFLY_PASSWORD" ]; then
echo ""
echo "Setting manager password..."
add-user.sh -u manager -p $WILDFLY_PASSWORD -r ManagementRealm
fi
print_app_credentials $BITNAMI_APP_NAME manager `print_wildfly_password`
else
print_container_already_initialized $BITNAMI_APP_NAME
fi
chown -R $BITNAMI_APP_USER:$BITNAMI_APP_USER $BITNAMI_APP_VOL_PREFIX/conf/ $BITNAMI_APP_VOL_PREFIX/logs/ /app/ || true
if [ "$1" = 'standalone.sh' -o "$1" = 'domain.sh' ]; then
set -- $@ $PROGRAM_OPTIONS $EXTRA_OPTIONS
initialize_wildfly_deployments_directory
exec gosu $BITNAMI_APP_USER "$@"
else
exec "$@"
fi
exec /init "$@"

View File

@@ -0,0 +1,22 @@
#!/usr/bin/with-contenv bash
set -e
source $BITNAMI_PREFIX/bitnami-utils.sh
print_welcome_page
if [ ! "$(ls -A $BITNAMI_APP_VOL_PREFIX/conf)" ]; then
generate_conf_files
if [ "$WILDFLY_PASSWORD" ]; then
echo ""
echo "Setting manager password..."
add-user.sh -u manager -p $WILDFLY_PASSWORD -r ManagementRealm
fi
print_app_credentials $BITNAMI_APP_NAME manager `print_wildfly_password`
else
print_container_already_initialized $BITNAMI_APP_NAME
fi
initialize_wildfly_deployments_directory
chown -R $BITNAMI_APP_USER:$BITNAMI_APP_USER $BITNAMI_APP_VOL_PREFIX/conf/ $BITNAMI_APP_VOL_PREFIX/logs/ /app/ || true

View File

@@ -0,0 +1 @@
/bin/true

View File

@@ -0,0 +1,5 @@
#!/usr/bin/with-contenv bash
set -e
source $BITNAMI_PREFIX/bitnami-utils.sh
exec s6-setuidgid $BITNAMI_APP_USER $BITNAMI_APP_DAEMON $PROGRAM_OPTIONS ${EXTRA_OPTIONS:+"$EXTRA_OPTIONS"}