Docker Part 4 - Deploy in Seconds to the Cloud with Docker Machines

If you have not read Part 3, please go here and read it first.

Docker machines are deprecated, please use the Resource Manager in Wappler instead.

So you have built your amazing dynamic site and you need to put it live on the internet?

With Docker Machines you create your live server in seconds and deploy to it.
Check the general introduction on Docker Machines

We have integrated Docker Machines now in Wappler, so it is really easy to create your own live server.

Introduction to Cloud Hosting

With cloud hosting you are creating you own virtual server with all the powers of full dedicated server.

With Docker Machines this virtual server is completely configured for you automatically and Docker is installed. So you can deploy all the docker servers you want to it instantly

For now we have added support for Digital Ocean as cloud provider but more providers are coming up.

Start with Digital Ocean and get $50

Digital Ocean is a very solid and affordable cloud server provider, with hosting facilities all over the world.

As a introduction to it - you can get $50 hosting credit by making an account with this link

This will give you a good start to experiment with cloud hosting for at least few months.

Docker Machines in Wappler

Creating a new Docker Machine in Wappler is very easy.
Just go to your project settings, targets, create new target, select Docker Engine (1), Remote connection (2) and then click on the Manage button (3) to get the Docker Machines Manager

The Docker Machines Manager

The Docker Machines Manager will popup and retrieve the list of your docker machines. Initially you probably won’t have any, so you will see:

Creating a New Docker Machine

Let’s create a new Docker Machine that will be our Live Server. To do so just click on the Add New button.

You will see a new Docker Machine form where you can enter the name and choose a cloud provider to use:

Currently the selection is for Digital Ocean but we will be adding more soon.
So choose Digital Ocean.

If you haven’t created an account yet click on “Create Account” button and you will get $50 credit to start!

If you have an account go to the Digital Ocean control panel and generate an Access Token so that Wappler can create the server for you.

Enter the token name and hit generate token:

image

Then go back to Wappler and paste the Access Token.

Choose the Region depending on where you are your customer are based (1) and Size of your server (2). Usually the smallest will be just fine for just $5 for month!

Then hit the Create (3)

Now and all the magic will happen! The server is being created for you in just a matter of seconds! All the needed OS software is installed and also docker is installed configured.

When done you will see that everything went well and that the Docker Machine - your live server is fully created and operational (1)

So just go back to the list of Docker Machines (2)

There is our brand new server live and kicking!

So just select it by clicking it (1) and then hit the “select” button (2)

You will now see that the Docker Machine properties are populated now in your new target:

So you can just save it and get ready to deploy your site to it!

Deploy to your brand new server

Now that we have created our brand new server, we can deploy our site to it.

Just switch the active target to our new Live Server target:

and hit the Deploy button.

image

Another magic happens and all the needed docker images, like web server and database are installed and deployed to your new server:

When ready you will see the green light!

Open your index page if you haven’t done it already in Wappler:

and then hit the Open In Browser icon

Voila! You have your site fully deployed!

Monitoring your servers on Digital Ocean

You can also see your live server in the Control panel of Digital ocean, just go to the droplets section:

Click on the server to see how it is running:

Removing the Docker Machine

Suppose you are done with testing and you want to remove your server, so you are not charged any longer by Digital Ocean.

Just go back to the Docker Machines Manager in Wappler Project options, select the server and click delete:

You are warned that is is a permanent deletion and you can’t go back, so think twice before confirming it:

Server is completely destroyed and removed at Digital Ocean.

So we are left now with an empty list.

Conclusion

So now you see how easy it is to deploy as full blown docker server live on internet thanks to Wappler and it’s integration with Docker Machines.

So try it out and let us know what you think - and don’t forget to use the special link for Digital Ocean account to get the $50 credit!

4 Likes

Bit of a problem even though this is a great update - i have been struggling to work Docker into my workflow. The problem is this - i have updated to 2.3.2 but don’t have the option button to “Manage” Docker Machine - am i missing something? It certainly doesn’t look like the screen shot here

Same issue as @Spencer_Clark

You have to switch the experimental features on in options / system to see the new Docker Machine Manager

I’m getting an error:

Same when wanting to create a new docker machine:

Have I missed something obvious @George ?

Do you have docker installed on your device?

You must have docker desktop installed it run it all.

Maybe this is so blatantly obvious for most, but I had no idea this was required.

Tried installing docker desktop just now but it requires me to have Windows 10 pro or enterprise, which I don’t have…

This is Part 4 @nevil

Maybe you should check the other parts first:

the name (host) you have entered may have invalid characters try digitalOcean or something like that

He just don’t have Docker Desktop installed, as it doesn’t run on Windows 10 Home - but needs Windows 10 Pro at least for the Hyper-V support.

Happily it is all free on Mac and Linux …

But we will also add more checks to the interface to warn you before any Docker usage if you don’t have Docker Desktop installed yet.

4 Likes

Yeah such a bummer. I read that Microsoft will also enable integration with Docker on Windows 10 home, but not sure when that will be implemented.

And no, I’m not upgrading to Mac. Been there, done that. :wink:

This is what I stated in one of my posts – that after reading all the “Ultra fast web development with Docker in Wappler” articles after one of the updates of Wappler there was no explicit “THIS New Functionality WILL REQUIRE the Docker Desktop Application first be installed on your localhost machine. You can go to this link and get the download.”

Or something similar.

I am on a Mac with the latest operating system and I was getting errors before I stumbled upon the Docker Desktop Application.

I had to research elsewhere to discover why Wappler was showing me errors.

But the Wappler Tutorials skipped Step # 1 – Installing Docker Desktop

It’s only natural that Docker newbies need that crucial info before exploring Wappler integration.

@NewMedia
If you read the first article if the docker series, then you will see:

Maybe an idea to also state this in Wappler in the error message “Error creating docker machine”. Add something like: “have you installed docker desktop?”

Yes that is what I said

3 posts were split to a new topic: Docker Targets and Database structure

This is totally awesome. I tried to set up docker in digitalocean manually but got hung up on generating SSH files.

This config worked flawlessly.

2 Likes