You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Sumesh R Acharya <7....@gmail.com> on 2023/05/01 08:43:29 UTC

Docker deployment for multi-tenant instance

Hello community,

Can anyone help me with  Multi-tenant deployment using docker scripts.
Like when running the multi-tenant in the system we have to execute the
create tenant command in the first run, how to run this command when
deploying the application by using docker scripts.



Regards,
Sumesh

Re: Docker deployment for multi-tenant instance

Posted by Daniel Watford <da...@foomoo.co.uk>.
Hi Sumesh,

[Note: 22.01 has not been released yet. If you are using container images
published by the OFBiz project please note that they have the '-snapshot'
suffix to denote that they are not an official release. Other than that, it
is good to hear that people are trying out OFBiz in containers.]

I haven't dealt with multi-tenant support in OFBiz and it is not handled
out-of-the box for the container implementation provided in the
release22.01 and trunk branches.

On trunk, I see lines 511 to 596 implement the createTenant gradle task. To
use multi-tenant OFBiz in a container you will need to re-implement the
same task as a bash script and place it in one of the hook directories
mentioned in my previous message, or add tenant functionality to the
docker-entrypoint.sh script (which would still be some sort of port of the
gradle task to bash).

I imagine the above isn't really what you were looking for, though.
Depending on the number of tenants you need to support in your OFBiz
instance, would you consider running a container per tenant, all with
connections to a shared database?

Dan.

On Tue, 2 May 2023 at 09:03, Sumesh R Acharya <7....@gmail.com> wrote:

> Hi Daniel,
>
> Thanks for your response.
> I am using latest release 22.01 and i was using the docker scripts which
> are there in the repo.
>
> When we run the ofbiz project in the system (non-dockerized version) for
> the multitenant we have to execute the *create tenant *command in the first
> run and this command required *gradlew *script, now in case of dockerized
> version the archive(ofbiz.tar) which we use inside the docker image doesn't
> have that gradlew script .
> so i want to know how i can perform this step using bash script or any
> other method in the dockerized version.
>
> Full command looks like
> ./gradlew createTenant -PtenantId=tenant1 -PtenantName="tenant1"
> -PdomainName=tenant1.example.com -PtenantReaders=seed,seed-initial,ext
> -PdbPlatform=P -PdbIp=localhost -PdbUser=ofb_tenant1 -PdbPassword=ofbiz
>
>
> Regards,
> Sumesh
>
>
> On Tue, 2 May, 2023, 11:39 am Daniel Watford, <da...@foomoo.co.uk> wrote:
>
> > Hi Sumesh,
> >
> > You didn't mention which version of OFBiz you are working with, or the
> > source of the scripts you are using to manage your docker containers.
> >
> > On the trunk and release22.01 branches, the OFBiz project recently
> > introduced the ability to build and run OFBiz using containers. You might
> > find the implementation useful and be able to incorporate the ideas into
> > your own scripts. See
> > https://github.com/apache/ofbiz-framework/blob/trunk/Dockerfile for the
> > container build process and
> >
> >
> https://github.com/apache/ofbiz-framework/blob/trunk/docker/docker-entrypoint.sh
> > for the container entry point script.
> >
> > https://github.com/apache/ofbiz-framework/blob/trunk/DOCKER.md has
> > information about building and running OFBiz in a container. I think the
> > section on Hooks might be helpful for your situation.
> >
> > Using hooks you can run your own bash scripts at various points during
> > initialisation for the first run of OFBiz. We use hooks for the demo
> > websites, such as
> >
> >
> https://github.com/apache/ofbiz-tools/tree/master/demo-backup/ofbizdocker/home/ofbizdocker/demo-next/after-config-applied.d
> > for the https://demo-next.ofbiz.apache.org/partymgr site.
> >
> > Hope that helps,
> >
> > Dan.
> >
> >
> > On Mon, 1 May 2023 at 09:43, Sumesh R Acharya <7....@gmail.com>
> > wrote:
> >
> > > Hello community,
> > >
> > > Can anyone help me with  Multi-tenant deployment using docker scripts.
> > > Like when running the multi-tenant in the system we have to execute the
> > > create tenant command in the first run, how to run this command when
> > > deploying the application by using docker scripts.
> > >
> > >
> > >
> > > Regards,
> > > Sumesh
> > >
> >
> >
> > --
> > Daniel Watford
> >
>


-- 
Daniel Watford

Re: Docker deployment for multi-tenant instance

Posted by Sumesh R Acharya <7....@gmail.com>.
Hi Daniel,

Thanks for your response.
I am using latest release 22.01 and i was using the docker scripts which
are there in the repo.

When we run the ofbiz project in the system (non-dockerized version) for
the multitenant we have to execute the *create tenant *command in the first
run and this command required *gradlew *script, now in case of dockerized
version the archive(ofbiz.tar) which we use inside the docker image doesn't
have that gradlew script .
so i want to know how i can perform this step using bash script or any
other method in the dockerized version.

Full command looks like
./gradlew createTenant -PtenantId=tenant1 -PtenantName="tenant1"
-PdomainName=tenant1.example.com -PtenantReaders=seed,seed-initial,ext
-PdbPlatform=P -PdbIp=localhost -PdbUser=ofb_tenant1 -PdbPassword=ofbiz


Regards,
Sumesh


On Tue, 2 May, 2023, 11:39 am Daniel Watford, <da...@foomoo.co.uk> wrote:

> Hi Sumesh,
>
> You didn't mention which version of OFBiz you are working with, or the
> source of the scripts you are using to manage your docker containers.
>
> On the trunk and release22.01 branches, the OFBiz project recently
> introduced the ability to build and run OFBiz using containers. You might
> find the implementation useful and be able to incorporate the ideas into
> your own scripts. See
> https://github.com/apache/ofbiz-framework/blob/trunk/Dockerfile for the
> container build process and
>
> https://github.com/apache/ofbiz-framework/blob/trunk/docker/docker-entrypoint.sh
> for the container entry point script.
>
> https://github.com/apache/ofbiz-framework/blob/trunk/DOCKER.md has
> information about building and running OFBiz in a container. I think the
> section on Hooks might be helpful for your situation.
>
> Using hooks you can run your own bash scripts at various points during
> initialisation for the first run of OFBiz. We use hooks for the demo
> websites, such as
>
> https://github.com/apache/ofbiz-tools/tree/master/demo-backup/ofbizdocker/home/ofbizdocker/demo-next/after-config-applied.d
> for the https://demo-next.ofbiz.apache.org/partymgr site.
>
> Hope that helps,
>
> Dan.
>
>
> On Mon, 1 May 2023 at 09:43, Sumesh R Acharya <7....@gmail.com>
> wrote:
>
> > Hello community,
> >
> > Can anyone help me with  Multi-tenant deployment using docker scripts.
> > Like when running the multi-tenant in the system we have to execute the
> > create tenant command in the first run, how to run this command when
> > deploying the application by using docker scripts.
> >
> >
> >
> > Regards,
> > Sumesh
> >
>
>
> --
> Daniel Watford
>

Re: Docker deployment for multi-tenant instance

Posted by Daniel Watford <da...@foomoo.co.uk>.
Hi Sumesh,

You didn't mention which version of OFBiz you are working with, or the
source of the scripts you are using to manage your docker containers.

On the trunk and release22.01 branches, the OFBiz project recently
introduced the ability to build and run OFBiz using containers. You might
find the implementation useful and be able to incorporate the ideas into
your own scripts. See
https://github.com/apache/ofbiz-framework/blob/trunk/Dockerfile for the
container build process and
https://github.com/apache/ofbiz-framework/blob/trunk/docker/docker-entrypoint.sh
for the container entry point script.

https://github.com/apache/ofbiz-framework/blob/trunk/DOCKER.md has
information about building and running OFBiz in a container. I think the
section on Hooks might be helpful for your situation.

Using hooks you can run your own bash scripts at various points during
initialisation for the first run of OFBiz. We use hooks for the demo
websites, such as
https://github.com/apache/ofbiz-tools/tree/master/demo-backup/ofbizdocker/home/ofbizdocker/demo-next/after-config-applied.d
for the https://demo-next.ofbiz.apache.org/partymgr site.

Hope that helps,

Dan.


On Mon, 1 May 2023 at 09:43, Sumesh R Acharya <7....@gmail.com> wrote:

> Hello community,
>
> Can anyone help me with  Multi-tenant deployment using docker scripts.
> Like when running the multi-tenant in the system we have to execute the
> create tenant command in the first run, how to run this command when
> deploying the application by using docker scripts.
>
>
>
> Regards,
> Sumesh
>


-- 
Daniel Watford