It is possible to add two local DB docker to a project? Right now I have the one is setup up in project settings, can I add another docker db with the database manager?
Thank you!
It is possible to add two local DB docker to a project? Right now I have the one is setup up in project settings, can I add another docker db with the database manager?
Thank you!
Yes, you should be able to add multiple local docker databases via the resource manager, they can be the same type or different types
These videos may help
https://www.youtube.com/playlist?list=PLUjqTJN3byC_KhuPg-vSqD6fgAzC0dBJz
Sorry @Hyperbytes, now I see that I formulated badly my question due to my low tecnhical knowledge.
By local I mean inside the same docker container as the project. So I’m trying to achive a docker container with one image called web-1, another image called db-1 and a third image called db-2.
If I use the Resource Manager and create a local DB it’s stored in his own Docker container I want it to be in the same container as the webapp.
Each project has a docker-compose file that defines each container that runs. This means you could manually modify such file to add a 2nd database server. You’d then need to add a new database connection so your app knows how to connect to it:
You’ll then need to setup the Database Direct Connection on Wappler to connect to localhost (127.0.0.1),at the port that’s published on your docker-compose file (which you’ll have to define in first place):
Do note that the fundament in docker is to have each service in its own container. So the web service goes in one and database in other.
They are all grouped in a single docker composer file but still always remain in own containers that share the same network.
So by creating more database containers in the Resource Manager you are actually doing more of the same.
I suggested that to him @apple but for some reason but he wants both databases running in the same default docker container rather than using a second container which the resource manager produces
Thanks, I didn’t knew this feature of resource manager! I’m going to use it
My doubts come from the fact that I understand that if you create a DB through the “Resource Manager” it is created locally, that is to say, in my pc.
If I understand correctly, if I click on the “deploy” button, it will upload the main container to Hetzner but it will not upload the containers that I have made via the “Resource Manager”? Is this correct?
You also create a replica of the local container on your production server and they can be managed via the database manager in the same way as the main container.its all in the videos
I came to the conclusion the services created through the Resource Manager are not tied to the Wappler project, so the docker-compose files are not modified. Not useful for me
Thats exactly what I was trying to say! Maybe we need a way to create more databases tied to the Wappler project? It souldnt be hard to do, right?
No, they are a separate container which can be either exclusive or shared between app depending on the needs of the user. There sharing is based around having the credentials. If only one app has connection credentials then it is effectively tied to that project.
Remember, deploy in wappler DOES NOT overwrite databases.if it did so this would be catastrophic as the production database would be destroyed and replaced by the development database losing all data.
Thats why databases are separately managed via the database manager.
Using the resource manager simply means you have two databases, both manageable via the database manager within your project which just happen to reside in two separate containers.
I’m not sure I understand you, but let me clarify my point of view:
If another developer opens the same Wappler project, both databases (containers) need to be started by docker-compose, there can’t be any sort of manual configuration such as manually going to the resource manager and deploying a database there, that goes against the concept of docker-compose.
What’s missing is in the target configuration, there could be an array of databases instead of a single DB configuration
Yes wappler will open two new local docker containers for the based on the stored schema however the production target will remain shared
Good point indeed.
We do actually save the used resources per project so those can be recreated by other users of the project.
This is done for the cloud servers for now, not yet for local services but will see if we can automatically also create those if not existing yet.