DEV Community

Ajeet Singh Raina
Ajeet Singh Raina

Posted on

2 Minutes to Liferay CE using Docker Desktop

Liferay Portal is an open-source portal framework for building web applications, websites, and portals. It also offers an integrated CMS and may serve as an enterprise integration platform.

Prerequisite

Writing a Compose file

Copy the following content and save it as docker-compose.yml file.



services:
  liferay:
    image: ibaiborodine/liferay-portal-ce
    environment:
      LIFERAY_SETUP_PERIOD_WIZARD_PERIOD_ENABLED: "false"
      LIFERAY_TERMS_PERIOD_OF_PERIOD_USE_PERIOD_REQUIRED: "false"
      LIFERAY_USERS_PERIOD_REMINDER_PERIOD_QUERIES_PERIOD_ENABLED: "false"
      LIFERAY_USERS_PERIOD_REMINDER_PERIOD_QUERIES_PERIOD_CUSTOM_PERIOD_QUESTION_PERIOD_ENABLED: "false"
    ports:
      - "80:8080"


Enter fullscreen mode Exit fullscreen mode

Start the container



docker compose up -d


Enter fullscreen mode Exit fullscreen mode

Wait till the time container gets started completely



[+] Building 0.0s (0/0)                                                                                                                docker:default
[+] Running 2/2
 ✔ Network root_default      Created                                                                                                             0.1s 
 ✔ Container root-liferay-1  Started                                                                                                             0.1s


Enter fullscreen mode Exit fullscreen mode


root-liferay-1  | 26-Jul-2024 17:50:05.417 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [1158] milliseconds
root-liferay-1  | Loading jar:file:/opt/liferay/tomcat-9.0.56/webapps/ROOT/WEB-INF/shielded-container-lib/portal-impl.jar!/system.properties
root-liferay-1  | Loading jar:file:/opt/liferay/tomcat-9.0.56/webapps/ROOT/WEB-INF/shielded-container-lib/portal-impl.jar!/portal.properties
root-liferay-1  | 2024-07-26 17:50:14.063 INFO  [main][PortalContextLoaderListener:123] JVM arguments: -Djava.util.logging.config.file=/opt/liferay/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dfile.encoding=UTF-8 -Djava.locale.providers=JRE,COMPAT,CLDR -Djava.net.preferIPv4Stack=true -Duser.timezone=GMT -Xms2560m -Xmx2560m -XX:MaxNewSize=1536m -XX:MaxMetaspaceSize=768m -XX:MetaspaceSize=768m -XX:NewSize=1536m -XX:SurvivorRatio=7 -Dignore.endorsed.dirs= -Dcatalina.base=/opt/liferay/tomcat -Dcatalina.home=/opt/liferay/tomcat -Djava.io.tmpdir=/opt/liferay/tomcat/temp
root-liferay-1  | 2024-07-26 17:52:07.567 WARN  [main][DialectDetector:82] Liferay is configured to use Hypersonic as its database. Do NOT use Hypersonic in production. Hypersonic is an embedded database useful for development and demonstration purposes. The database settings can be changed in portal-ext.properties.
root-liferay-1  | 2024-07-26 17:52:07.567 INFO  [main][DialectDetector:153] Using dialect com.liferay.portal.dao.orm.hibernate.HSQLDialect for HSQL Database Engine 2.3
root-liferay-1  | 2024-07-26 17:52:30.127 INFO  [main][ModuleFrameworkImpl:1237] Starting initial bundles
root-liferay-1  | 2024-07-26 17:52:35.106 INFO  [ModuleFramework-Static-Bundles-5][InterpolationConfigurationPlugin:109] Configured directory for secrets: /opt/liferay/osgi/configs
root-liferay-1  | 2024-07-26 17:52:46.689 INFO  [main][ModuleFrameworkImpl:1534] Started initial bundles
root-liferay-1  | 2024-07-26 17:52:46.690 INFO  [main][ModuleFrameworkImpl:1583] Starting dynamic bundles
root-liferay-1  | 2024-07-26 17:53:17.920 INFO  [main][ModuleFrameworkImpl:1605] Started dynamic bundles
root-liferay-1  | 2024-07-26 17:53:17.926 INFO  [main][ModuleFrameworkImpl:1612] Starting web bundles
root-liferay-1  | 2024-07-26 17:53:23.752 INFO  [main][ModuleFrameworkImpl:1666] Started web bundles
root-liferay-1  | 2024-07-26 17:53:23.753 INFO  [main][ModuleFrameworkImpl:253] Navigate to Control Panel > System > Gogo Shell and enter "lb" to see all bundles
root-liferay-1  | 2024-07-26 17:53:27.906 WARN  [main][SidecarManager:103] Liferay automatically starts a child process of Elasticsearch named sidecar for convenient development and demonstration purposes. Do NOT use sidecar in production. Refer to the documentation for details on the limitations of sidecar and instructions on configuring a remote Elasticsearch connection in the Control Panel.


Enter fullscreen mode Exit fullscreen mode

Verify if container is up and running



docker compose ps
NAME             IMAGE                            COMMAND                  SERVICE   CREATED          STATUS          PORTS
root-liferay-1   ibaiborodine/liferay-portal-ce   "docker-entrypoint.s…"   liferay   11 minutes ago   Up 11 minutes   11311/tcp, 0.0.0.0:80->8080/tcp
[node1] (local) root@192.168.0.8 ~
$ 


Enter fullscreen mode Exit fullscreen mode

Visit http://localhost:80

Image2

The default Liferay Portal configuration contains embedded Hypersonic database and Elasticsearch instances.

Top comments (0)