Commit 22634402 authored by Ralph Soika's avatar Ralph Soika

issue #5

parent 56d81d21
FROM jboss/wildfly
# Version 1.1.0
FROM debian:jessie
# Imixs-Microservice Version 1.2.0
MAINTAINER ralph.soika@imixs.com
####################################################################
# Setup User Imxis
####################################################################
USER root
# add jessie backports
RUN echo "#Backports" >> /etc/apt/sources.list && echo deb http://http.debian.net/debian jessie-backports main >> /etc/apt/sources.list
# Create a user and group used to launch processes
# The user ID 1000 is the default for the first "regular" user on Fedora/RHEL,
# so there is a high chance that this ID will be equal to the current user
# making it easier to use volumes (no permission issues)
RUN groupadd -r imixs -g 1000 && useradd -u 1000 -r -g imixs -m -d /opt/imixs -s /sbin/nologin -c "Imixs user" imixs && \
chmod 755 /opt/imixs
# Set the working directory to imixs' user home directory
WORKDIR /opt/imixs
# Specify the user which should be used to execute all commands below
USER imixs
#####################################################################
# Install PostgreSQL, Java-8, WildFly
#####################################################################
# User root user to install software
USER root
# Install necessary packages
RUN apt-get update && apt-get -q -y install postgresql wget openjdk-8-jre-headless openjdk-8-jdk
#####################################################################
# Setup postgreSQL Database 'imixs01'
#####################################################################
USER postgres
RUN /etc/init.d/postgresql start &&\
createuser -s imixs &&\
psql --command "ALTER USER imixs WITH PASSWORD 'imixs';" &&\
psql postgres -c "CREATE DATABASE imixs01 WITH ENCODING 'UTF8' TEMPLATE template0" &&\
psql postgres -c "ALTER DATABASE imixs01 OWNER TO imixs;" &&\
/etc/init.d/postgresql stop
#####################################################################
# Install Wildfly
#####################################################################
USER root
COPY src/docker/wildfly-install.sh ./
COPY src/docker/start.sh /opt/imixs/
RUN chmod a+x /opt/imixs/start.sh &&\
chmod a+x ./wildfly-install.sh &&\
./wildfly-install.sh &&\
rm wildfly-install.sh
USER imixs
#####################################################################
# Setup Wildfly
#####################################################################
# add admin account for wildfly console
USER jboss
USER root
RUN /opt/jboss/wildfly/bin/add-user.sh admin imixs --silent
RUN /opt/wildfly/bin/add-user.sh admin imixs --silent
# wildfly configuration
COPY src/docker/eclipselink.jar /opt/jboss/wildfly/modules/system/layers/base/org/eclipse/persistence/main/
COPY src/docker/module.xml /opt/jboss/wildfly/modules/system/layers/base/org/eclipse/persistence/main/
COPY src/docker/standalone.xml /opt/jboss/wildfly/standalone/configuration/
COPY src/docker/imixsrealm.properties /opt/jboss/wildfly/standalone/configuration/
COPY src/docker/eclipselink.jar /opt/wildfly/modules/system/layers/base/org/eclipse/persistence/main/
COPY src/docker/module.xml /opt/wildfly/modules/system/layers/base/org/eclipse/persistence/main/
COPY src/docker/standalone.xml /opt/wildfly/standalone/configuration/
COPY src/docker/imixsrealm.properties /opt/wildfly/standalone/configuration/
# deploy postgres jdbc
COPY src/docker/postgresql-9.3-1102.jdbc41.jar /opt/jboss/wildfly/standalone/deployments/
COPY src/docker/postgresql-9.3-1102.jdbc41.jar /opt/wildfly/standalone/deployments/
# deploy imixs-microservice.war
COPY target/imixs-microservice-*.war /opt/jboss/wildfly/standalone/deployments/
COPY target/imixs-microservice*.war /opt/wildfly/standalone/deployments/
EXPOSE 8080
# use to start bash
#CMD ["bash"]
# Set the default command to run on boot
# This will boot WildFly in the standalone mode and bind to all interface
#CMD ["/opt/wildfly/bin/standalone.sh", "-b", "0.0.0.0"]
CMD ["/opt/imixs/start.sh"]
########################################################
# NOTE:
# run it with : docker run -it -p 8080:8080 imixs-microservice
# run in admin mode use: docker run -it -p 8080:8080 -p 9990:9990 imixs-microservice /opt/jboss/wildfly/bin/standalone.sh -b 0.0.0.0 -bmanagement 0.0.0.0
# run in admin mode use: docker run -it -p 8080:8080 -p 9990:9990 imixs-microservice /opt/wildfly/bin/standalone.sh -b 0.0.0.0 -bmanagement 0.0.0.0
########################################################
......@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.imixs.workflow</groupId>
<artifactId>imixs-microservice</artifactId>
<version>1.1.0</version>
<version>1.2.0</version>
<packaging>war</packaging>
<name>Imixs-Workflow Microservice</name>
......
......@@ -146,11 +146,11 @@
</security>
</datasource>
<datasource jta="false" jndi-name="java:/jdbc/workflow-db" pool-name="workflow-db" enabled="true" use-ccm="false">
<connection-url>jdbc:postgresql://imixs-database-host/postgres</connection-url>
<connection-url>jdbc:postgresql://localhost/imixs01</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<driver>postgresql-9.3-1102.jdbc41.jar</driver>
<security>
<user-name>postgres</user-name>
<user-name>imixs</user-name>
<password>imixs</password>
</security>
<validation>
......
#!/bin/bash
#title :start.sh
#description :Start script for postgreSQL and Wildfly
#author :initial: Ralph Soika
#date :20161116
#usage :/bin/bash start.sh
echo "starting server..."
/etc/init.d/postgresql start
/opt/wildfly/bin/standalone.sh -b 0.0.0.0 -bmanagement 0.0.0.0
#!/bin/bash
#title :wildfly-install.sh
#description :The script to install and run Wildfly 9.x in a Docker container
#more :http://sukharevd.net/wildfly-8-installation.html
#author :initial: Dmitriy Sukharev, changes:Ralph Soika
#date :20161116
#usage :/bin/bash wildfly-install.sh [INSTALLDIR] [PORTOFFSET]
function usage
{
echo "usage: wildfly-install [[[-v version ] [-d installdir] [-p portbase]]]"
}
WILDFLY_VERSION=9.0.2.Final
INSTALL_DIR=/opt
PORT_BASE=0
# read options...
while [ "$1" != "" ]; do
case $1 in
-v | --version ) shift
WILDFLY_VERSION=$1
;;
-d | --installdir ) shift
INSTALL_DIR=$1
;;
-p | --portbase ) shift
PORT_BASE=$1
;;
* ) usage
exit 1
esac
shift
done
WILDFLY_FILENAME=wildfly-$WILDFLY_VERSION
WILDFLY_ARCHIVE_NAME=$WILDFLY_FILENAME.tar.gz
WILDFLY_DOWNLOAD_ADDRESS=http://download.jboss.org/wildfly/$WILDFLY_VERSION/$WILDFLY_ARCHIVE_NAME
WILDFLY_FULL_DIR=$INSTALL_DIR/$WILDFLY_FILENAME
WILDFLY_DIR=$INSTALL_DIR/wildfly
WILDFLY_USER="wildfly"
WILDFLY_SERVICE="wildfly"
WILDFLY_STARTUP_TIMEOUT=240
WILDFLY_SHUTDOWN_TIMEOUT=30
echo WILDFLY_VERSION=$WILDFLY_VERSION
echo PORT_BASE=$PORT_BASE
echo INSTALL_DIR=$INSTALL_DIR
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root."
exit 1
fi
echo "Downloading: $WILDFLY_DOWNLOAD_ADDRESS..."
[ -e "$WILDFLY_ARCHIVE_NAME" ] && echo 'Wildfly archive already exists.'
if [ ! -e "$WILDFLY_ARCHIVE_NAME" ]; then
wget -q $WILDFLY_DOWNLOAD_ADDRESS
if [ $? -ne 0 ]; then
echo "Not possible to download Wildfly."
exit 1
fi
fi
echo "Cleaning up..."
rm -f "$WILDFLY_DIR"
rm -rf "$WILDFLY_FULL_DIR"
rm -rf "/var/run/$WILDFLY_SERVICE/"
rm -f "/etc/init.d/$WILDFLY_SERVICE"
echo "Installation..."
mkdir $WILDFLY_FULL_DIR
tar -xzf $WILDFLY_ARCHIVE_NAME -C $INSTALL_DIR
rm $WILDFLY_ARCHIVE_NAME
ln -s $WILDFLY_FULL_DIR/ $WILDFLY_DIR
useradd -s /sbin/nologin $WILDFLY_USER
chown -R $WILDFLY_USER:$WILDFLY_USER $WILDFLY_DIR
chown -R $WILDFLY_USER:$WILDFLY_USER $WILDFLY_DIR/
echo "...Installation done."
\ No newline at end of file
......@@ -108,8 +108,8 @@ public class SetupServlet extends HttpServlet {
// try to init system indizies and load default models
try {
logger.info("Imixs-Microservice - checking default model...");
setupService.init();
logger.info("Imixs-Microservice - update index list...");
setupService.updateIndexList();;
} catch (AccessDeniedException e1) {
logger.severe("SetupServlet - unable to init system "
+ e1.getMessage());
......
......@@ -3,7 +3,7 @@
##############################
setup.mode=auto
#setup.defaultModel=ticket.ixm
setup.defaultModel=
# Mail Plugin configuration
mail.defaultSender=info@mydomain.com
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment