Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 0900e15d authored by Joze RIHTARSIC's avatar Joze RIHTARSIC
Browse files

Add oracle docker files

parent 73ffb503
No related branches found
No related tags found
No related merge requests found
Showing
with 151 additions and 14 deletions
version: "3.0"
services:
database:
image: oracle/database:11.2.0.2-xe
container_name: smp_oracle_db
volumes:
- ./properties/db-scripts:/u01/app/oracle/scripts/setup # init script.
- shared-status-folder:/u01/status/
ports:
- 1721:1521
shm_size: '1gb'
weblogic:
depends_on:
- database
# command: [bash, -c, "for i in `seq 10`; do timeout 1 bash -c '</dev/tcp/database/1521'; if [ $$? -eq 0 ] ; then break;fi;sleep 1; done;"]
command: [bash, -c, "for i in `seq 150`; do timeout 1 bash -c 'echo \" $$(ls /u01/status/)\"'; if [ -f '/u01/status/database.log' ] && [ \"$$( cat /u01/status/database.log )\" == 'DATABASE IS READY TO USE!' ] ; then break;fi; echo \"$$i. Wait for database!\"; sleep 2; done; /u01/oracle/startAdminServer.sh"]
image: weblogic_smp
container_name: wls-smp
hostname: wlsadmin
volumes:
- ./properties/weblogic:/u01/oracle/properties
- shared-status-folder:/u01/status/
ports:
- 7901:7001
volumes:
shared-status-folder:
create tablespace smp_tblspace datafile 'smp_tblspace.dat' size 10M autoextend on;
create temporary tablespace smp_tblspace_temp tempfile 'smp_tblspace_temp.dat' size 5M autoextend on;
create user smp identified by test default tablespace smp_tblspace temporary tablespace smp_tblspace_temp;
grant create session to smp;
grant create sequence to smp;
grant create table to smp;
grant unlimited tablespace to smp;
exit;
username=weblogic
password=Weblogic1
JAVA_OPTIONS=-Dweblogic.StdoutDebugEnabled=false
#!/bin/bash
WORKING_DIR="$(dirname $0)"
SMP_INIT_DATABASE="../../../smp-webapp/src/main/smp-setup/database-scripts/oracle10g.ddl"
SMP_INIT_DATABASE_DATA="../../../smp-webapp/src/main/smp-setup/database-scripts/oracle10g-data.sql"
# soap ui data
PREFIX="smp-wls-orcl"
echo "Working Directory: ${WORKING_DIR}"
cd "$WORKING_DIR"
# clear volume and containers - to run restart from strach
# READ argumnets
while getopts i: option
do
case "${option}"
in
i) SMP_INIT_DATABASE_DATA=${OPTARG};;
esac
done
# create database init script from
echo "CONNECT smp/test@//localhost:1521/xe;" > ./properties/db-scripts/02_oracle10g.sql
cat "${SMP_INIT_DATABASE}" >> ./properties/db-scripts/02_oracle10g.sql
# copy init database data for SMP
if [ ! -f "${SMP_INIT_DATABASE_DATA}" ]
then
echo "SMP sql init data '${SMP_INIT_DATABASE_DATA} not found!!"
exit 1;
else
# copy artefact to docker build folder
echo "CONNECT smp/test@//localhost:1521/xe;" > ./properties/db-scripts/03_oracle10g-data.sql
cat "${SMP_INIT_DATABASE_DATA}" >> ./properties/db-scripts/03_oracle10g-data.sql
fi
function clearOldContainers {
echo "Clear containers and volumes"
docker-compose -p "${PREFIX}" rm -s -f -v
docker volume rm "${PREFIX}_shared-status-folder"
}
#
# Always delete shared-status-folder else weblogic will start to quick!
# because statuses are sync over shared-status-folder folders and it could contain status from previous run.
clearOldContainers
# start
docker-compose -p ${PREFIX} up -d --force-recreate
# wait until service is up
for i in `seq 100`; do timeout 1 bash -c ' curl --head --silent --fail http://localhost:7901/smp/'; if [ $? -eq 0 ] ; then break;fi; echo "$i. Wait for weblogic to start!"; sleep 5; done;
#!/bin/bash
WORKING_DIR="$(dirname $0)"
echo "Working Directory: ${WORKING_DIR}"
cd "$WORKING_DIR"
PREFIX="smp-wls-orcl"
# clear volume and containers - to run restart from strach
function clearOldContainers {
echo "Clear containers and volumes"
docker-compose -p "${PREFIX}" rm -s -f -v
docker volume rm "${PREFIX}_shared-status-folder"
}
# stop and clear
clearOldContainers
......@@ -46,6 +46,7 @@ ENV ORACLE_BASE=/u01/app/oracle \
# Use second ENV so that variable get substituted
ENV PATH=$ORACLE_HOME/bin:$PATH
ENV NLS_LANG=AMERICAN_AMERICA.AL32UTF8
# Copy binaries
# -------------
......
......@@ -44,6 +44,9 @@ RUN apt-get update \
&& echo "\nAdd init parameters" >> $SMP_HOME/apache-tomcat-$TOMCAT_VERSION/smp/conf/smp.config.properties \
&& echo "\nauthentication.blueCoat.enabled=true" >> $SMP_HOME/apache-tomcat-$TOMCAT_VERSION/smp/conf/smp.config.properties
RUN curl -o /tmp/org.jacoco.agent.jar https://repo1.maven.org/maven2/org/jacoco/org.jacoco.agent/0.8.4/org.jacoco.agent-0.8.4-runtime.jar
# copy application to image
ADD ./artefacts /tmp/artefacts
......
......@@ -12,7 +12,7 @@
# HOW TO BUILD THIS IMAGE
# -----------------------
# Run:
# $ docker build -t weblogic-sml .
# $ docker build -t weblogic-smp .
#
# Pull base image
# ---------------
......@@ -21,6 +21,10 @@ FROM oracle/12213-domain-home-in-image
# Define variable
ARG SMP_VERSION
ENV APP_VERSION=$SMP_VERSION
ENV LC_ALL=en_US.UTF-8
ENV LANG="en_US.UTF-8"
ENV LANGUAGE="en_US"
......@@ -29,7 +33,11 @@ COPY container-scripts/* /u01/oracle/
COPY smp.war /u01/oracle/
RUN /u01/oracle/deploySMPToDomain.sh && \
wlst -loadProperties /u01/oracle/datasource.properties.oracle /u01/oracle/ds-deploy.py
wlst -loadProperties /u01/oracle/datasource.properties.oracle /u01/oracle/ds-deploy.py \
# set enforce-valid-basic-auth-credentials false to allow basic authentication for rest services
&& sed -i -e "s/<\/security-configuration>/ <enforce-valid-basic-auth-credentials>false<\/enforce-valid-basic-auth-credentials>\n<\/security-configuration>/g" "/u01/oracle/user_projects/domains/domain1/config/config.xml"
# Define default command to start bash.
CMD ["startAdminServer.sh"]
#!/bin/bash
#
#Define DOMAIN_HOME
echo "Domain Home is: " $DOMAIN_HOME
......@@ -10,19 +8,18 @@ if [ ! -d "$DOMAIN_HOME/classes" ]; then
mkdir -p "$DOMAIN_HOME/classes";
fi
if [ ! -d "$DOMAIN_HOME/bdmsl" ]; then
mkdir -p "$DOMAIN_HOME/bdmsl";
fi
# create smp property file
echo "hibernate.dialect=org.hibernate.dialect.Oracle10gDialect" >> "$DOMAIN_HOME/classes/smp.config.properties"
echo "hibernate.dialect=org.hibernate.dialect.Oracle10gDialect" > "$DOMAIN_HOME/classes/smp.config.properties"
echo "datasource.jndi=jdbc/cipaeDeliveryDs" >> "$DOMAIN_HOME/classes/smp.config.properties"
echo "authentication.blueCoat.enabled=true" >> "$DOMAIN_HOME/classes/smp.config.properties"
echo "log.folder=./logs/" >> "$DOMAIN_HOME/classes/smp.config.properties"
# create weblogic classpath to classes folder
echo "export CLASSPATH=\${CLASSPATH}:\${DOMAIN_HOME}/classes" >> "$DOMAIN_HOME/bin/setDomainEnv.sh"
cp /u01/oracle/smp.war "$DOMAIN_HOME/"
# Deploy Application
wlst.sh -skipWLSModuleScanning /u01/oracle/smp-app-deploy.py
......@@ -14,7 +14,7 @@ public enum SMPPropertyEnum {
PARTC_SCH_REGEXP ("identifiersBehaviour.ParticipantIdentifierScheme.validationRegex","^((?!^.{26})([a-z0-9]+-[a-z0-9]+-[a-z0-9]+)|urn:oasis:names:tc:ebcore:partyid-type:(iso6523:|unregistered:).+)","Participant Identifier Schema of each PUT ServiceGroup request is validated against this schema.", false, false , SMPPropertyTypeEnum.REGEXP),
PARTC_SCH_REGEXP_MSG ("identifiersBehaviour.ParticipantIdentifierScheme.validationRegexMessage",
"Participant scheme must start with:urn:oasis:names:tc:ebcore:partyid-type:(iso6523:|unregistered:) OR must be up to 25 characters long. The Scheme Identifier MUST take the form [domain]-[identifierArea]-[identifierType] (ex.: 'busdox-actorid-upis') and may only contain the following characters: [a-z0-9]+-[a-z0-9]+-[a-z0-9]+. ", "Error message for UI",false, false , SMPPropertyTypeEnum.STRING),
"Participant scheme must start with:urn:oasis:names:tc:ebcore:partyid-type:(iso6523:|unregistered:) OR must be up to 25 characters long with form [domain]-[identifierArea]-[identifierType] (ex.: 'busdox-actorid-upis') and may only contain the following characters: [a-z0-9].", "Error message for UI",false, false , SMPPropertyTypeEnum.STRING),
CS_PARTICIPANTS("identifiersBehaviour.caseSensitive.ParticipantIdentifierSchemes","casesensitive-participant-scheme1|casesensitive-participant-scheme2","Specifies schemes of participant identifiers that must be considered CASE-SENSITIVE.", false, false , SMPPropertyTypeEnum.LIST_STRING),
CS_DOCUMENTS("identifiersBehaviour.caseSensitive.DocumentIdentifierSchemes","casesensitive-doc-scheme1|casesensitive-doc-scheme2","Specifies schemes of document identifiers that must be considered CASE-SENSITIVE.", false, false , SMPPropertyTypeEnum.LIST_STRING),
......
......@@ -27,7 +27,7 @@ set define off;
insert into SMP_USER (ID, USERNAME, PASSWORD, ROLE, ACTIVE, CREATED_ON, LAST_UPDATED_ON) values (SMP_USER_SEQ.nextval, 'peppol_user', '$2a$10$.pqNZZ4fRDdNbLhNlnEYg.1/d4yAGpLDgeXpJFI0sw7.WtyKphFzu', 'SMP_ADMIN', 1, sysdate, sysdate);
insert into SMP_USER (ID, USERNAME, PASSWORD, ROLE, ACTIVE, CREATED_ON, LAST_UPDATED_ON) values (SMP_USER_SEQ.nextval, 'the_admin', '', 'SMP_ADMIN', 1, sysdate, sysdate);
insert into SMP_USER (ID, USERNAME, PASSWORD, ROLE, ACTIVE, CREATED_ON, LAST_UPDATED_ON) values (SMP_USER_SEQ.nextval, 'AdminSMP1TEST', '$2a$06$u6Hym7Zrbsf4gEIeAsJRceK.Kg7tei3kDypwucQQdky0lXOLCkrCO', 'SERVICE_GROUP_ADMIN', 1, sysdate, sysdate);
insert into SMP_USER (ID, USERNAME, PASSWORD, ROLE, ACTIVE, CREATED_ON, LAST_UPDATED_ON) values (SMP_USER_SEQ.nextval, 'AdminSMP1TEST', '$2a$06$u6Hym7Zrbsf4gEIeAsJRceK.Kg7tei3kDypwucQQdky0lXOLCkrCO', 'SMP_ADMIN', 1, sysdate, sysdate);
insert into SMP_USER (ID, USERNAME, PASSWORD, ROLE, ACTIVE, CREATED_ON, LAST_UPDATED_ON) values (SMP_USER_SEQ.nextval, 'AdminSMP2TEST', '$2a$10$h8Q3Kjbs6ZrGkU6ditjNueINlJOMDJ/g/OKiqFZy32WmdhLjV5TAi', 'SMP_ADMIN', 1, sysdate, sysdate);
insert into SMP_USER (ID, USERNAME, PASSWORD, ROLE, ACTIVE, CREATED_ON, LAST_UPDATED_ON) values (SMP_USER_SEQ.nextval, 'test', '', 'SMP_ADMIN', 1, sysdate, sysdate);
insert into SMP_USER (ID, USERNAME, PASSWORD, ROLE, ACTIVE, CREATED_ON, LAST_UPDATED_ON) values (SMP_USER_SEQ.nextval, 'test1', '$2a$06$toKXJgjqQINZdjQqSao3NeWz2n1S64PFPhVU1e8gIHh4xdbwzy1Uy', 'SMP_ADMIN', 1, sysdate, sysdate);
......@@ -40,8 +40,9 @@ insert into SMP_USER (ID, USERNAME, PASSWORD, ROLE, ACTIVE, CREATED_ON, LAST_UPD
insert into SMP_CERTIFICATE (ID, CERTIFICATE_ID, VALID_FROM, VALID_TO, CREATED_ON, LAST_UPDATED_ON) values (SMP_USER_SEQ.CURRVAL, 'CN=EHEALTH_SMP_EC,O=European Commission,C=BE:f71ee8b11cb3b787', null,null, sysdate, sysdate);
insert into SMP_USER (ID, USERNAME, PASSWORD, ROLE, ACTIVE, CREATED_ON, LAST_UPDATED_ON) values (SMP_USER_SEQ.nextval, 'EHEALTH_ż_ẞ_Ẅ_,O', '', 'SMP_ADMIN', 1, sysdate, sysdate);
insert into SMP_CERTIFICATE (ID, CERTIFICATE_ID, VALID_FROM, VALID_TO, CREATED_ON, LAST_UPDATED_ON) values (SMP_USER_SEQ.CURRVAL, 'CN=EHEALTH_z_ẞ_W_,O=European_z_ẞ_W_Commission:f71ee8b11cb3b787', null,null, sysdate, sysdate);
insert into SMP_USER (ID, USERNAME, PASSWORD, ROLE, ACTIVE, CREATED_ON, LAST_UPDATED_ON) values (SMP_USER_SEQ.nextval, 'EHEALTH_z_ẞ_W_,O', '', 'SMP_ADMIN', 1, sysdate, sysdate);
insert into SMP_CERTIFICATE (ID, CERTIFICATE_ID, VALID_FROM, VALID_TO, CREATED_ON, LAST_UPDATED_ON) values (SMP_USER_SEQ.CURRVAL, 'CN=EHEALTH_z_ẞ_W_,O=European_z_ẞ_W_Commission,C=BE:f71ee8b11cb3b787', null,null,sysdate, sysdate);
insert into SMP_USER (ID, USERNAME, PASSWORD, ROLE, ACTIVE, CREATED_ON, LAST_UPDATED_ON) values (SMP_USER_SEQ.nextval, 'EHEALTH_SMP_1000000007-1', '', 'SMP_ADMIN', 1, sysdate, sysdate);
insert into SMP_CERTIFICATE (ID, CERTIFICATE_ID, VALID_FROM, VALID_TO, CREATED_ON, LAST_UPDATED_ON) values (SMP_USER_SEQ.CURRVAL, 'CN=EHEALTH_SMP_1000000007,O=DG-DIGIT,C=BE:000000000123ABCD', null,null, sysdate, sysdate);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment