The remote docker target is run on Digital Ocean, using Traefik for SSL and connected to the domain succesfully.
I want to add a third environment to use as development, like a dev.website.com where I can push updates to and get test it remotely before deploying to production.
How do I do that?
I tried to create a new target in the Project Settings → Point to same docker machine → Set Web Server URL to dev.website.com.
But this broke the current production target, in Portainer I could see that things are trying to run on conflicting ports and I think that the root domain was getting routed to the staging docker container.
@mebeingken
Hi Ken, I have been looking into this as well. The idea of having to spin up a separate droplet for each site seems to be a bit expensive. The use case I have in mind is when using subdomains on the same main domain and Traefik as the reverse proxy. Following @George steps for setting up Traefik, I set up separate targets letting Traefik create the subdomain for me by entering the full subdomain in the webserver URL portion of the targets settings (leave port empty)
The question as I took it was that @karh wanted to know how to stage each of these targets with wappler on the local target. I too have this question. Does anyone have a solution?
I’m not exactly sure what you are looking to achieve, but I’ll add some more thoughts in hopes of helping.
By way of example, I am building an app that supports a multi-tenant environment that can each have its own sub-domain (or external custom domain.) This is one Wappler project, deployed to one target (one each for Dev, Staging, and Production.) I setup apache to support a wild-card domain, and then alias all the custom domains in as well, and produce an ssl cert that supports it all. This single apache virtual host then proxies to the single node app.
For an example, let’s say we have a university program for client who wants separate structural areas for each focus area and separate subs. Two separate sub domain are created: https://area1.university.edu, https://area2.university.edu.
The issue, how to accomplish this in Wappler using a single droplet. Using Traefik you can indeed setup separate targets to create separate subs, but to make everything work I think you would need the following:
create and map a directory for each of the subs on the remote machine
create a separate folder on the local machine for each sub as well.
Hope that conveys the question better?
Doing that in Wappler is the issue. There are tutorials on DO and other sites that show you how to do this with Traefik or Apache virtual sites… I just cant figure out how to do it on Wappler. Was this @karh question as well?
After playing with the setup a bit more I was able to accomplish the task by creating a new project.
After creating a new project and selecting a new local folder I created a new remote target, choose the docker-machine created earlier, and in the WEB section entered the new subdomain as the url. This created the new sub and everything worked perfectly. Except for the database containers created an error. Not sure what to do here but making progress.
@dmbe11 Yes Daniel, I think we are trying to achieve the same here.
I don’t recall exactly but I think I’ve done the same as you wrote in your last comment. But I was hosting the database/webserver on the same ports which caused errors.
I could figure that out by using portainer and checking which containers are running.
So first start the containers on different ports (hopefully through the target settings like you just tried).
Secondly, set up Traefik as a reverse proxy. (No idea how yet)
PS @mebeingken this project is also a multi-tenant environment. Can you share a few more details? Are you using Node and Docker? Apache is used instead of docker, no?
Actually you can already publish multiple Wappler projects on a single docker server.
You just use the same docker machine.
It is not recommended however to use different docker database servers for each project as it will result in creating multiple database servers in your single docker server and those are pretty memory intensive.
So in short - you can have as many Wappler web projects as you wish on a single server, but try letting them use a central database server or a separate managed database.
Yes, for this project I am using apache with node...no docker involved here. I did some testing to load it in a DO app container but I forgot about a custom server requirement which ruled that out (at least until I re-tool something.)
I did notice something that might save you some time, when setting up the remote database connection your managed database on DO, if you select the “Digital Oceans RDS” setting in the SSL section of the dialog box, you will receive an error. To fix I choose the default setting and it worked fine.