Configure an environment before running the Oracle WebCenter Portal Docker container. You need to set up a communication network between containers on the same host and a WebCenter Content Server instance.
Create a user-defined network to enable containers to communicate by running the following command:
$ docker network create -d bridge WCPortalNET
You need to have a running WebCenter Content Server on any machine. The Content server connection details are required for configuring WebCenter Portal during configuration process.
Note : This step is required only when the WebCenter Portal uses Content Server as content repository.
To run the Oracle WebCenter Portal Docker container, you need to create:
- Container to manage the Admin Server.
- Container to manage the Managed Server.
Create an environment file webcenter.env.list
file, to define the parameters.
Update the parameters inside webcenter.env.list
as per your local setup.
#Database Configuration
DB_DROP_AND_CREATE=<true or false>
DB_CONNECTION_STRING=<Hostname/ContainerName>:<Database Port>/<DB_PDB>.<DB_DOMAIN>
DB_RCUPREFIX=<RCU Prefix>
DB_PASSWORD=<Database Password>
DB_SCHEMA_PASSWORD=<Schema Password>
#configure container
ADMIN_SERVER_CONTAINER_NAME=<Admin Server Container Name>
ADMIN_PORT=<Admin Server Port>
ADMIN_PASSWORD=<Admin Server Password>
ADMIN_USERNAME=<Admin Server User Name>
MANAGED_SERVER_PORT=<Managed Server Port>
# Configure Content Server
CONFIGURE_UCM_CONNECTION=<true or false>
#Valid option for socket type are socket,jaxws
UCM_SOCKET_TYPE=<UCM Socket Type >
#Required if UCM_SOCKET_TYPE is jaxws
UCM_URL=<Configure UCM URL If Socket type is jaxws>
UCM_HOST=<UCM Host>
UCM_PORT=<UCM Port>
UCM_ADMIN_USER=<UCM Admin User>
# Configure Elasticsearch Server
SEARCH_APP_USERNAME=<Search User Name>
SEARCH_APP_USER_PASSWORD=<Search User Password>
Run the following command to create the Admin Server container:
$ docker run -i -t --name $ADMIN_SERVER_CONTAINER_NAME --network=WCPortalNET -p <Any Free Port>:$ADMIN_PORT -v $DATA_VOLUME:/u01/oracle/user_projects --env-file <directory>/webcenter.env.list $WCPortalImageName
Note: Replace variables with values configured in webcenter.env.list The above command deletes any previous RCU with the same prefix if DB_DROP_AND_CREATE=true
The docker run command creates the container as well as starts the Admin Server in sequence given below:
- Node Manager
- Admin Server
When the command is run for the first time, we need to create the domain and configure the portal server, so following are done in sequence:
- Loading WebCenter Portal schemas into the database
- Creating WebCenter Portal domain
- Configuring Node Manager
- Starting Node Manager
- Starting Admin Server
$ docker container stop WCPAdminContainer
$ docker container start -i WCPAdminContainer
Run the following command to create the Portal Managed Server container:
$ docker run -i -t --name WCPortalContainer --network=WCPortalNET -p <Any Free Port>:$MANAGED_SERVER_PORT -v $DATA_VOLUME:/u01/oracle/user_projects --env-file <directory>/webcenter.env.list $WCPortalImageName configureOrStartWebCenterPortal.sh
Note: Replace variables with values configured in webcenter.env.list
The docker run command creates the container as well as starts the WebCenter Portal managed server.
When the command is run for the first time, WebCenter Content Server connection creation is also done if CONFIGURE_UCM_CONNECTION=true.
$ docker container stop WCPortalContainer
$ docker container start -i WCPortalContainer
$ docker exec -it WCPortalContainer /bin/bash
To create an Elasticsearch container, we can reuse the environment file webcenter.env.list
from the above example.
We need to mount data volume to store crawled data outside the Elasticsearch container.
To mount a host directory /scratch/wcpdocker/volumes/es
($ES_DATA_VOLUME) as a data volume, execute the below command.
$ sudo mkdir -p /scratch/wcpdocker/volumes/es
$ sudo chown 1000:1000 /scratch/wcpdocker/volumes/es
$ docker run -i -t --name ESContainer --network=WCPortalNET -p 9200:9200 --volumes-from WCPortalContainer -v $ES_DATA_VOLUME:/u01/esHome/esNode/data --env-file <directory>/webcenter.env.list $WCPortalImageName configureOrStartElasticsearch.sh
$ docker container stop ESContainer
$ docker container start -i ESContainer
To reuse a existing domain we need to comply with existing domain configuration given in webcenter.env.list
and container names.
Follow below instruction to recreate a container in such a way that they continue using existing domain on data volume.
Delete existing container (ESContainer,WCPortalContainer and WCPAdminContainer)
$ docker container stop ESContainer
$ docker container stop WCPortalContainer
$ docker container stop WCPAdminContainer
$ docker container rm ESContainer
$ docker container rm WCPortalContainer
$ docker container rm WCPAdminContainer
Reuse the WebCenter Portal database schema
Update the following parameter inside webcenter.env.list
:
DB_DROP_AND_CREATE=false
Create container pointing to existing domain Run the command to create Container in given Sequence (run as non root user)
# create Admin Container
$ docker run -i -t --name WCPAdminContainer --network=WCPortalNET -p 7001:7001 -v /scratch/wcpdocker/volumes/wcpportal:/u01/oracle/user_projects --env-file /scratch/<userid>/docker/webcenter.env.list oracle/wcportal:12.2.1.4.0
# create Portal Container
$ docker run -i -t --name WCPortalContainer --network=WCPortalNET -p 8888:8888 -v /scratch/wcpdocker/volumes/wcpportal:/u01/oracle/user_projects --env-file /scratch/<userid>/docker/webcenter.env.list oracle/wcportal:12.2.1.4.0 configureOrStartWebCenterPortal.sh
# create Elasticsearch Container
$ docker run -i -t --name ESContainer --network=WCPortalNET -p 9200:9200 --volumes-from WCPortalContainer -v /scratch/wcpdocker/volumes/es:/u01/esHome/esNode/data --env-file /scratch/<userid>/docker/webcenter.env.list oracle/wcportal:12.2.1.4.0 configureOrStartElasticsearch.sh
In case of any error or want a new fresh instance then you need to follow given instruction in sequence:
Delete existing container (WCPAdminContainer, WCPortalContainer and ESContainer)
Delete data from shared data volume
# below command should be run as root user
$ rm -rf $ES_DATA_VOLUME/*
$ rm -rf $DATA_VOLUME/*
Drop and recreate the WebCenter Portal database schema
$ docker container stop ESContainer
$ docker container stop WCPortalContainer
$ docker container stop WCPAdminContainer
$ docker container rm ESContainer
$ docker container rm WCPortalContainer
$ docker container rm WCPAdminContainer
Update the following parameter inside webcenter.env.list
:
DB_DROP_AND_CREATE=true
Create containers
Run the command to create Container in given Sequence (run as non root user)
# create Admin Container
$ docker run -i -t --name WCPAdminContainer --network=WCPortalNET -p 7001:7001 -v /scratch/wcpdocker/volumes/wcpportal:/u01/oracle/user_projects --env-file /scratch/<userid>/docker/webcenter.env.list oracle/wcportal:12.2.1.4.0
# create Portal Container
$ docker run -i -t --name WCPortalContainer --network=WCPortalNET -p 8888:8888 -v /scratch/wcpdocker/volumes/wcpportal:/u01/oracle/user_projects --env-file /scratch/<userid>/docker/webcenter.env.list oracle/wcportal:12.2.1.4.0 configureOrStartWebCenterPortal.sh
# create Elasticsearch Container
$ docker run -i -t --name ESContainer --network=WCPortalNET -p 9200:9200 --volumes-from WCPortalContainer -v /scratch/wcpdocker/volumes/es:/u01/esHome/esNode/data --env-file /scratch/<userid>/docker/webcenter.env.list oracle/wcportal:12.2.1.4.0 configureOrStartElasticsearch.sh
Copyright (c) 2020, Oracle and/or its affiliates.