Having problem setting up 3 targets, (DEV, PROD. STAGE)

Hi guys! i'm having a problem trying to setup this.

I have right now 2 targets (development, production)

but i wanna to have a stage target so i can have a online version to receive webhooks.

(I know you can do it with ngrok, but there's a limit of 3 free webhooks) and i need way more than that.

The problem i'm facing is when i create the new target (in the same custom VPS) even though i explicit set a new database port and deploy it, looks fine until i try for exemple: create an user, the data goes to the production database.

Investigating i found that this is happening (i guess) because the database under .wappler -> targets -> (target_name) - databases - db.json still have the same port number as the dev and production, i changed but every time i make changes that file returns to the default port number 9906

the docker-compose.yml doesn't change

What i'm missing here? Should i edit the db file every time before a deploy? Or there's a better way to proper setup a third target in the same VPS, keeping the database in a separeted docker image.

Thanks in advance!

Here's some thoughts:

  1. There are alternatives to ngrok that handle the tunnel, such as one from Cloudflare. I used to have a "remove dev" target as well, and have gotten rid of it in favor of this...much easier: https://keyholesoftware.com/use-a-cloudflare-tunnel-to-easily-access-local-resources/#:~:text=You%20could%20open%20a%20port,That's%20where%20Cloudflare%20comes%20in.
  2. For each database connection there are 2 connection strings to be setup. One that is used when connecting from Wappler the editor, and another that is used for the target itself...the connections strings are often different.

Here is an example of my local db from the perspective of Globals (that which is used on the target) and Database Manager (that which is used in the editor.)

Instead of changing things on the target panel, you might try changing the connection in Globals. Make sure you select the active target that you wish to edit, before opening the database connection file for editing.

1 Like

Hey @mebeingken thanks for your response! i'll be trying this approach!