Digital Ocean Install Docker

Here is what i did to Set up a laravel Project in Digital Ocean

Install Docker

SSH to your Server

Thankfully, Docker provides us with a really nice tool for building docker hosts easily in quite a few hosting providers. For this tutorial, we’re going to host with Digital Ocean (that link will get you a $10 credit for signing up) and creating our host using docker-machine. Without dockers then I would have to provision another Digital Ocean droplet and install that particular OS. Able to run multiple instances of the same Docker Image, upgrade and test and make sure the newer version of the application works before switching over to production mode.

you will be prompt of that password.
type the password you receive in your email

then it will ask to you to change a new password
just change it to the custom root password you want

After SSH
you can check that docker command is working by typing

Set Up Your Laravel Project

Install docker-compose command

Create Your LaraDock Containers

Go to Your Workspace

Install laravel Dependencies, Add .env , generate Key and give proper permission certain folder

you can then view your laravel site at your ipaddress
for example

You will see there Laravel Default Welcome Page

but if you need to view on your custom domain name
which you would.

Using Your Own Domain Name

login to your DNS provider
Godaddy, Namecheap what ever...
And Point the Custom Domain Name Server to

In Your Digital Ocean Account go to

add your domain name and choose the server ip you provision earlier

Serve Site With NGINX (HTTP ONLY)

Go back to command line

Docker Machine Ubuntu

Digital Ocean Install Docker

remove default_server

and add server_name (your custom domain)

Rebuild Your Nginx

Re Run Your Containers MYSQL and NGINX

View Your Site with HTTP ONLY (http://yourdomain.com)

Run Site on SSL with Let's Encrypt Certificate

Note: You need to Use Caddy here Instead of Nginx
To go Caddy Folders and Edit CaddyFile

Remove 0.0.0.0:80

and replace with your https://yourdomain.com

uncomment tls

and replace self-signed with your email address

This is needed Prior to Creating Let's Encypt

Run Your Caddy Container without the -d flag and Generate SSL with Let's Encypt

OceanDigital Ocean Install Docker

you will be prompt here to enter your email... you may enter it or not

Digital Ocean Install Docker

After it finish Press Ctrl + C to exit ...

Stop All Containers and ReRun Caddy and Other Containers on Background

Digital Ocean Install Docker Ubuntu

View your Site in the Browser Securely Using HTTPS (https://yourdomain.com)

Digital Ocean Install Phpmyadmin

Note that Certiface will be Automatically Renew By Caddy

References :

Uninstall Docker Ubuntu

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04
https://www.digitalocean.com/products/one-click-apps/docker/
https://docs.docker.com/engine/installation/linux/ubuntulinux/
https://docs.docker.com/compose/install/
https://caddyserver.com/docs/automatic-https
https://caddyserver.com/docs/tls
https://caddyserver.com/docs/caddyfile