My lessons of Node.js/Heroku/Docker/Caprover and the PHP world - bloody forehead

Sorry tor the long intro here - as I’ve read many others who have dealt with this - my sanity needs to share.

Been a week of beating my forehead on the wall - reading/watching tutorials - all to this point:

  1. If you know how to ask the questions - this community has the answers - a wonderful resource
  2. Thank you to so many for sharing your insights - Caprover setup; Node.js on CPanel; new Youtube series on setting up Node.js/SQLite
  3. I’ve learned - haven’t produced a new page in a week - but I’ve setup plenty of “containers”
  4. I wonder how frustrated the Wappler team gets reading some of these posts. As a former tech support/trainer - I remember as a client to send me a copy of the file - he put the floppy disk on the Xerox machine and mailed it to me. :man_shrugging: :slight_smile:
  5. I’ve setup a Digital Ocean account, pushed a Docker container, and can even see the page.
  6. I’ve even gotten Navicat connected to the local Docker container.

I’m going to post my questions individually so not to mix up the topics. Thanks again to everyone with your sharing of ideas and training.

4 Likes

And a week later - what a mess - Still trying to understand the Docker/Spaces world. Learned there’s a traefik option - met to learn that this week, but I can’t get images to upload to Spaces, so I may be headed back to PHP land. Two weeks stumbling through this has almost got me beat. Ben’s videos have been great, there’s so many holes in the stepping stones though, looking like NodeJS will win this battle. :man_shrugging:

I feel your pain. I have given up on Docker long ago. :frowning:

I suppose it depends how much you complicate it yourself, and in saying that I suppose it really depends on your end goal and needs.

To simplify this to anyone reading.

Here are the different routes you can take

  1. Get a Domain Name through a domain registrar of your choice
  2. Get a shared linux hosting account through the hosting provider of your choice

If you want a standard PHP, MySQL type site

  1. Open cPanel, create a database
  2. In cPanel create a FTP user unless one is already created for you that you want to use.
  3. Open Wappler, create new PHP project, connect things in the simplest way first, and if successful then start upscaling, in other words, start by trying to connect to your FTP, but in the simplest way, no SSL certificates etc. Once working if you need add the SSL type stuff, etc.
  4. Connect to your database
  5. Start your job.

Advantages of this are cPanel has a nice little File Manager, it has phpMyAdmin if needed, it has IP blacklisting/whitelisting, you can generally have a simple SSL certificate on the sit for free, you can control your .htaccess file simply and add redirects in cPanel, you can easily see the files added to your server, you can upload directly to your server, you can easily look at error logs, you can add cPanel mail accounts as needed, with POP, IMAP, SMTP, and webmail interfaces.

Possible disadvantages, well there are a couple but my biggest one is many shared hosts do not auto support NodeJS if you wanted to switch later. And Slow in general.

OR

Same as above but get a VPS, or private dedicated server and the only real difference is you can control the WHM side behind the cPanel side.
This means you can control PHP versions per site, change certificate providers if desired, add NodeJS support with EasyApache, Switch between Maria DB vs normal MySQL, and many other things too.

No real disadvantages I can think of off hand, you can pretty much control everything and anything you like.

Both the Above setups worked great for years before, the only trouble is the learning curve for cPanel, WHM, and then the local staging accounts setup on your own computer, maybe having to add WAMP, MAMP, LAMP, or the PHP will not parse locally, Configuring local FTP servers etc.

OR

Docker, which is like having all the above and more and more and more in one, my examples will use Digital Ocean because I am more familiar with it.

  1. Get a Domain Name through a domain registrar of you choice, point either a few A records at Digital Ocean or the core NS records which is easier.
  2. Sign up on Digital Ocean for an account, and do nothing more.
  3. Optionally pre download Docker Desktop (You do not have to have an account there at all), pre download LTS version of NodeJS, both Wappler can do on Auto with its Homebrew, so up to you.

First lets deal with local staging environment setup, well you do not need anything, its all done for you. No local servers to install or configure.

If you want WHM/cPanel, then create a Docker Machine with that, and you can use it exactly like you used the shared, VPS, Private Dedicated Server setup, you can have NodeJS enabled through EasyApache, passenger, and PHP all running at the same time.
OR
Add a Docker Machine with only a Database server on it and use a shared database server for all your projects if you want that.
OR
Do the recommended Wappler style NodeJS/Docker configuration

  1. Open Digital Ocean, get an API Token, copy the long number
  2. Open Wappler setup your NodeJS/Docker project
  3. Make sure you local environment is all working
  4. Add a remote docker connection
  5. Manage Docker, paste in your API Token, choose the options and Wappler does it all for you.
  6. Add a database connection, it auto connects to it already.

Full instructions here

Don’t get me wrong there are disadvantages with this too
Such as you need Traefik for SSL, you either need to check logs and files uploaded with SSH into the docker machine, or install portainer for ease. Luckily Wappler makes this very easy so not a big hurdle.

Here are the painful parts you find out as you go, I am talking specifically Docker Machine with NodeJS, MariaDB, Traefik, Portainer, and that all

There is no FTP client to view your remote files easily, so you have to use a standalone FTP client or SSH, if you use a client, your connection needs to be with SSL Certificates, so a slight pain

There is no mail server to speak of, so if you want mail its easier to point off some of your MX records to something like Google For Business.

User Uploads, Docker Machines use Containers / Images / Volumes, each time you deploy the container for Web is overwritten, so User Uploads either need to go into an AWS S3 Bucket, or Docker Spaces OR just a User Uploads Volume, which is the easiest.

In Wappler open your project setting and add a User Uploads Folder, wham, a new Docker Volume is created, that never get overwritten on deploy, point all your User Uploads to that folder path and your issues are over.
You can connect to the user uploads folder via SSH or via a standalone FTP Client.

The log files can be read via Portainer or directly in Wappler now, however scheduled tasks, (the same as cron jobs in cPanel, but for NodeJS) build up huge log files you may need to configure a little different to suit your needs.

Hopefully some of this points you in some kind of direction. I also know there are many other setups too like Plesk, but I am only talking about what is in my comfort zone.

12 Likes

Thank you for your time to write such an in depth reply. Much appreciated.

3 Likes

Last Christmas I spent a very painful week trying to move to Docker. I decided life was too short and stuck with my existing setup…

2 Likes

I did the same things with a 17 year marriage once, but in the wise words of Ghandi, “I am inevitable”, or maybe that was Thanos, haha.

7 Likes

Cheeky bastard.

2 Likes

Sounds like we’ve been walking the same path Paul. It appears you’ve overcome the steps I’m battling. Items I’ve come to think of as standard resources on my shared services provider for the last 15 years (SSL/email/FTP/MySQL) were not anticipated as put of a new learning process.

Leaning towards Brad’s decision… Thank you everyone

1 Like

I think we should move faster to support the Digital Ocean App platform more out of the box, just as we do with Heroku.

So you will be just publishing apps, not maintaining servers with docker.

Will make your life a bit easier :slight_smile:

11 Likes

i dumped docker some time ago. Seemed great until it screwed up. I lost me security credentials via a crash and couldn’t recover them. and got locked out of the site. Customer was not happy!

Could have created a new droplet and redeployed but it destroyed my trust in docker. The only DO product i use now is spaces for images but that is only as i cant be bothered to migrate everything to the VPS and recode all the links

2 Likes

What credentials? AFAIK Docker as such has no credentials. Do you mean ssh keys to connect remotely?

Yes

1 Like

I was looking at the container world as being something simpler to work with. The reality has proven to be quite the opposite. I’m sure the Wappler team gets frustrated with so many newbies without solid knowledge of the languages and development. Thanks for your patience with us.

Well docker is definitely much easier than installing manually your own server with Linux, PHP/NodeJS, MySQL and Apache.

But you just have to get a hold on it.

2 Likes