Flexible deployment of Liferay using Docker and Nirmata Container Services
Liferay Portal is a popular open source enterprise web platform for content management and collaboration. Besides all the enterprise class features, what makes Liferay so popular is the various deployment options and integrations.
From an architectural standpoint, Liferay is a traditional, often referred to as a monolith, application but actual deployments can become quite complex spanning multiple servers. One way to simplify a deployment is by using application containers. In this post I will demonstrate how to simplify the deployment of Liferay using containers with Nirmata, a SaaS for application lifecycle management.
Nirmata allows rapid modeling of any application – traditional multi-tiered applications, complex microservices style applications as well as clustered applications. With Nirmata, the lifecycle of an application runtime (called an environment) is cleanly separated from the application definition (called a blueprint).
Some of our early customers started using Nirmata to deploy Liferay on their private cloud infrastructure. As we engaged with these customers, it became clear that businesses are challenging enterprise IT teams to address business needs faster. If central IT teams cannot deliver on this, Line of Business (LoB) teams will look elsewhere, marginalizing the role of central IT organizations.
These line-of-business (LoB) teams used Liferay to deliver business critical capabilities but were unable to move quickly. Application developers would have to wait hours to get a development environment to create and test new capabilities. Developer self-service was really a ticketing system and creating application environments on VMs along with Chef or Puppet scripts was too brittle and error prone.
We worked with these customers to streamline the deployment of their environments by first containerizing Liferay and other necessary components and then creating an application blueprint in Nirmata. Primary goal was agility/productivity for developers but additional goals being portability across cloud infrastructure and cost savings on public cloud. Once the blueprint was created, developers could deploy a fully functional environment, on-demand in minutes to complete their tasks. Once they are done, the environment can be easily purged and the underlying resources (VMs) can be reused for other developers. No more waiting! Is it worth the effort? You bet! Why? How about 30% developer productivity boost? You do the math!
Next, I will walk you through the steps to deploy Liferay with Nirmata. This assumes some understanding of containers and Docker.
Deploying Liferay with Nirmata
- Create container images: First thing you need is a container image for Liferay and the backing database. You could create your own container images or use the ones available on the web. We have created the images and made the Dockerfiles available on our GitHub page.
- Create or import application blueprint: Once the images are created, you need to create an application blueprint in Nirmata. An application blueprint contains the definition of all the components (services) in your application. You can create a blueprint from scratch or import the Liferay blueprint from our catalog.
- Create services: Once you have imported the blueprint, you can see the services in the blueprint – mysql and liferay. Additional configuration such as ports, data volumes etc. can be provided here.
- Add dependency: You can also add dependencies to ensure that these services are started in the correct order. You can see in the screenshot below that liferay service is dependent on mysql service. This will ensure that the database container is started before liferay container is deployed. You can also inject the database IP address dynamically at deploy time using environment variables. This completely decouples the blueprint from the infrastructure making it flexible to deploy anywhere – public or private cloud or on your laptop.
- Add service affinity rule (optional): Another setting you can provide is service affinity to ensure that the entire application is deployed on a single host or VM. This setting is environment specific so you can choose how the application is deployed in different environments e.g. Dev-Test vs. Staging.
- Deploy: That’s it! Once you onboard your cloud resources in Nirmata, you can deploy the Liferay to an environment and within a few minutes everything should be up and running!
Once Liferay container is running, you can click on the IP Address link to bring up the Liferay Basic Configuration page.
Nirmata provides several other features such as health checks, scaling, monitoring etc. that simplifies management of complex applications. Using container with Nirmata simplifies ongoing application maintenance and updates. You also have tremendous flexibility in where the application is deployed – public clouds such as AWS or private clouds such as VMware vSphere and OpenStack.
Liferay Portal is just one example of the type of applications that can be deployed and managed with Nirmata. Using containers to package these applications creates a standard unit of deployment and operations and Nirmata provides the necessary operations and workflows to deliver these applications in enterprise environments.
While the deployment described in this post is fairly simple, our customers are finding success with more complex Liferay deployments that include application servers such as WebLogic and even clustered databases. We would love to hear from you if you are interested in addressing challenges your organization faces in deploying and operating complex applications!