Public Repository

Last pushed: 2 years ago
Short Description
Liferay instance prepared for use with Social Office, Liferay Sync and RCS Newsletter
Full Description

Liferay portal 6.2 CE ga4 on Tomcat 7, with POSTGRESQL database in deb/java7 context, prepared for running with plugins: Social Office, Liferay Sync and RCS Newsletter

Don't use these plugins without understanding their properties!

Version history:
0.1 working basic version
0.2n failed attempts
0.9 uncertain version
0.91 fully working version, prepared for Social Office, Liferay Sync and RCS Newsletter, open for discussion and improvement sugestions

How to setup?

  1. make a data only container in the right format at the location of your choice (xcgd/postgresql is chosen so that no shell is included later on)

docker create -v /<location of choice>/dbdata:/var/lib/postgresql --name=dbdata xcgd/postgresql:9.4 /bin/true

  1. now prepare a postgresql database with another than the default user 'pg', xcgd/postgresql:9.4 initiates a database.

docker run -d --name=pg_prepare --volumes-from dbdata -p 5432:5432 xcgd/postgresql:9.4

Connect using pgadmin with the database, the run the following SQL:

CREATE USER lportal WITH PASSWORD 'lportal';
CREATE DATABASE lportal WITH ENCODING 'UTF8';
GRANT ALL PRIVILEGES ON DATABASE lportal to lportal;

Don't expose ports to the database, so:

docker stop pg_prepare
docker rm -v pg_prepare

  1. Now install postgresql without exposed ports:

docker run -d --name=postgres_lr --volumes-from dbdata xcgd/postgresql:9.4

  1. And install the liferay portal:

docker run --name=lr -d -p 8080:8080 -v /<location of choice>/data/:/opt/liferay-portal-6.2-ce-ga4/data/ -v /<location of choice>/deploy:/opt/liferay-portal-6.2-ce-ga4/deploy -v /<location of choice>/ext-properties:/var/liferay-home/ext-properties --link postgres:db_lep -d -e DB_TYPE=POSTGRESQL richarduijen/liferay_so_lrsync:0.91

This makes a liferay portal run on localhost:8080 with only this port exposed, exposing (optionally) in a place of your choice a 'deploy' directory for liferay plugins (if not installed via the marketplace), a 'data' directory in which the plugin data are stored, an 'ext-properties' directory in which a portal-ext.properties file can be put with settings for other plugins, as well as a 'dbdata' directory with the postgresql database data. Make sure these directories are only accessible by an administrator.

I think this configuration is pretty secure, while giving all required access for backup/restore procedures. Giving access to this configuration should, however, be done (for instance) through apache httpd and not directly. But that is beyond the scope of this image.

I look forward to reading comments, or improvement suggestions.

Richard Uijen
richard.uijen@ru4d.nl

Dockerfile contents (sorry for the lay-out, a wysiwyg editor would have been a nice feature):

<quote>
# Liferay + Social Office + Liferay Sync + RCS Newsletter
#
# 0.1 (20150901): working version with persistent postgresql database without plugins
# 0.2 (20150902): failed version
# 0.9 (20150907): version ready to import all plugins (so, sync, rcs newsletter) and ready for further extension. Plugins requiring other settings than in portal-ext.properties require a new build
#
# Based on Liferay 6.2 VERSION 0.0.7 using liferay 6.2-ce-ga4 by Samuel Nasello samuel.nasello@elosi.com
#
# Reason: I could'nt find any versions supporting persistent data (including pages) or liferay plug-ins. Furthermore, I wanted this particular configuration as a template.

#===================================================#
# Small size context of debian and Java 7 #
# contains unzip, curl, tar #
#===================================================#

FROM snasello/docker-debian-java7:7u79

MAINTAINER Richard Uijen richard.uijen@ru4d.nl

#===================================================#
# Basic Liferay 6.2 ce ga4 install with Tomcat 7 #
#===================================================#

# install liferay
RUN curl -O -s -k -L -C - http://downloads.sourceforge.net/project/lportal/Liferay%20Portal/6.2.3%20GA4/liferay-portal-tomcat-6.2-ce-ga4-20150416163831865.zip \
&& unzip liferay-portal-tomcat-6.2-ce-ga4-20150416163831865.zip -d /opt \
&& rm liferay-portal-tomcat-6.2-ce-ga4-20150416163831865.zip

#===================================================#
# Add database and plugin specific settings #
#===================================================#

# add config for databases
RUN /bin/echo -e '\nCATALINA_OPTS="$CATALINA_OPTS -Dexternal-properties=portal-bd-${DB_TYPE}.properties"' >> /opt/liferay-portal-6.2-ce-ga4/tomcat-7.0.42/bin/setenv.sh

# add configuration liferay file (content extended for plugins)
COPY lrsols/portal-bundle.properties /opt/liferay-portal-6.2-ce-ga4/portal-bundle.properties
COPY lrsols/portal-bd-MYSQL.properties /opt/liferay-portal-6.2-ce-ga4/portal-bd-MYSQL.properties
COPY lrsols/portal-bd-POSTGRESQL.properties /opt/liferay-portal-6.2-ce-ga4/portal-bd-POSTGRESQL.properties

#===================================================#
# Plugin info and instructions (Social Office, #
# Liferay Sync, RCS Newsletter) #
# #
# For loading plugins: in run: -v <folder>:/opt/ \ #
# liferay-portal-6.2-ce-ga4/ \ #
# deploy #
# #
# For portal-ext.properties: in run: -v <folder>: \ #
# /var/liferay-home/ext-properties/ #
# (location set in portal-bundle.properties #
# #
# Fror accessing and backing up of plugin data: #
# in run: -v <folder>: \ #
# /opt/liferay-portal-6.2-ce-ga4/data #
# #
# Social Office plugin preparations: #
# portal-bundle.properties adapted conformingly #
# Download and install SO in running liferay portal #
# #
# Liferay sync plugin preparations: #
# portal-bundle.properties adapted conformingly #
# Install Sync Connector CE from marketplace #
# Backup folder /opt/liferay-portal-6.2-ce-ga4/data/#
# document_library #
# Set max filesize to appropriate sizes in portal #
# #
# RCS Newsletter 3.1 plugin preparations: #
# portal-bundle.properties adapted conformingly #
# only set up for postgresql database #
# Install plugin via lr marketplace #
# follow userguide available in marketplace #
#===================================================#

# Ports
EXPOSE 8080

# Set JAVA_HOME
ENV JAVA_HOME /opt/java

# EXEC
CMD ["run"]
ENTRYPOINT ["/opt/liferay-portal-6.2-ce-ga4/tomcat-7.0.42/bin/catalina.sh"]
</quote>

Docker Pull Command
Owner
richarduijen