In Liferay Cloud, you are not limited to the standard set of services provided out-of-the-box. You can also create and deploy a custom service to run any new processes within the Liferay Cloud infrastructure. To use custom services on your Liferay Cloud environments, contact your sales representative to enable this functionality and ensure that your environments are provisioned accordingly.
Note
You must have sufficient hardware resources provisioned to be able to add a custom service. You can allocate additional resources for custom services during the provisioning process.
Liferay Cloud uses Docker images as the basis for its services. If you want to run these services locally, install Docker on your local system.
Use the following steps to add your own custom service to a build in Liferay Cloud:
Create or find your custom service as a Docker image. You can either use a Dockerfile that you add to your project’s workspace directly or an image from a public repository like Docker Hub.
Add a new directory for your service alongside the other service directories (e.g., liferay and database), with an LCP.json file in it:
If you trigger a build with a new custom service, but do not have enough resources provisioned for the new service, then it may interfere with the resources allocated to your other services.
Directly set the memory and CPU allocation for your new service in its LCP.json file to make sure it gets the correct amount of hardware resources.
Specify to which environments your custom service applies in your LCP.json. This may depend on how many resources you have provisioned for your new service.
For example, to only apply the build to your prd environment, add the following property to your LCP.json:
{
"environments": {
"prd": {
"deploy": true
}
}
}
By default, if no such properties are specified, the service attempts to build the custom service for all environments.
Apply your Docker image to the new service. The method to use to add your Docker image depends on whether you are using an image uploaded to a public repository, or a local Dockerfile.
If you are using a Docker image from a public repository: Add the name of your image to an image property within your LCP.json:
"image": "mydockerimages/myservice:1.0.0"
If you are using a local Dockerfile: Add the Dockerfile into your custom service’s directory. When your service is built, the Docker image from the Dockerfile is picked up as the image for the service automatically.
Note
The Dockerfile is automatically used as the image for your service. As a result, any “image” property in your LCP.json is ignored.
Commit these changes to your branch in version control:
Push your branch up and start a new build in Liferay Cloud to deploy. See the information on deployment in the Updating Services in Liferay PaaS for help with deploying your build.
Once you have triggered a new build in CI with your changes, you can navigate to the Builds screen in the Liferay Cloud console to see the build. The services listed under the Services column includes the new service with the others.
If you deploy this build to one of your environments (by clicking Deploy Build to in the Actions menu), then you can also navigate to that environment’s Services page to see the custom service listed there:
This website uses cookies and similar tools, some of which are provided by third parties (together “tools”). These tools enable us and the third parties to access and record certain user-related and activity data and to track your interactions with this website. These tools and the informationcollected are used to operate and secure this website, enhance performance, enable certain website features and functionality, analyze and improve website performance, and personalize user experience.
If you click “Accept All”, you allow the deployment of all these tools and collection of the information by us and the third parties for all these purposes.
If you click “Decline All” your IP address and other information may still be collected but only by tools (including third party tools) that are necessary to operate, secure and enable default website features and functionalities. Review and change your preferences by clicking the “Configurations” at any time.
Visite nossa Política de privacidade