create guides folder and clean the readme

This commit is contained in:
Mahmoud Zalt 2016-08-19 03:24:02 +03:00
parent e75da747a9
commit fb049ef300
3 changed files with 224 additions and 219 deletions

225
README.md
View File

@ -293,7 +293,7 @@ If you need a special support. Contact me, more details in the [Help & Questions
<a name="Docker"></a> <a name="Docker"></a>
### [Docker]
@ -475,7 +475,6 @@ docker logs {container-name}
<br> <br>
<a name="Laravel"></a> <a name="Laravel"></a>
### [Laravel]
@ -704,7 +703,6 @@ More details about this [here](https://github.com/jenssegers/laravel-mongodb#ins
<br> <br>
<a name="PHP"></a> <a name="PHP"></a>
### [PHP]
@ -857,223 +855,15 @@ To controll the behavior of xDebug (in the `php-fpm` Container), you can run the
<br> <br>
<a name="Production"></a> <a name="Production"></a>
### [Production]
<br> <br>
<a name="Digital-Ocean"></a> <a name="Digital-Ocean"></a>
### Setup Laravel and Docker on Digital Ocean ### Setup Laravel and Docker on Digital Ocean
####[Full Giude Here](https://github.com/LaraDock/laradock/blob/master/_guides/digital_ocean.md)
#### Install Docker
```
Login Digital Ocean
Add Droplet
1 Click Install docker
Choose Droplet
reset ROOT password
check email
```
#### SSH to your Server
```
ssh root@ipaddress
```
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
```
$root@midascode:~# docker
```
#### Set Up Your Laravel Project
```
$root@midascode:~# apt-get install git
$root@midascode:~# git clone https://github.com/laravel/laravel
$root@midascode:~# cd laravel
$root@midascode:~/laravel# git checkout develop
$root@midascode:~/laravel/ git submodule add https://github.com/LaraDock/laradock.git
$root@midascode:~/laravel/ cd laradock
```
#### Install docker-compose command
```
$root@midascode:~/laravel/laradock# curl -L https://github.com/docker/compose/releases/download/1.8.0/run.sh > /usr/local/bin/docker-compose
$root@midascode:~/chmod +x /usr/local/bin/docker-compose
```
#### Create Your LaraDock Containers
```
$root@midascode:~/laravel/laradock# docker-compose up -d nginx mysql
```
#### Go to Your Workspace
```
docker-compose exec workspace bash
```
#### Install laravel Dependencies, Add .env , generate Key and give proper permission certain folder
```
$ root@0e77851d27d3:/var/www/laravel# composer install
$ root@0e77851d27d3:/var/www/laravel# cp .env.example .env
$ root@0e77851d27d3:/var/www/laravel# php artisan key:generate
$ root@0e77851d27d3:/var/www/laravel# exit
$root@midascode:~/laravel/laradock# cd ..
$root@midascode:~/laravel# sudo chmod -R 777 storage bootstrap/cache
```
you can then view your laravel site at your ipaddress
for example
```
192.168.1.1
```
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
```
ns1.digitalocean.com
ns2.digitalocean.com
ns3.digitalocean.com
```
In Your Digital Ocean Account go to
```
https://cloud.digitalocean.com/networking/domains
```
add your domain name and choose the server ip you provision earlier
#### Serve Site With NGINX (HTTP ONLY)
Go back to command line
```
$root@midascode:~/laravel/laradock# cd nginx
$root@midascode:~/laravel/laradock/nginx# vim laravel.conf
```
remove default_server
```
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
```
and add server_name (your custom domain)
```
listen 80;
listen [::]:80 ipv6only=on;
server_name yourdomain.com;
```
#### Rebuild Your Nginx
```
$root@midascode:~/laravel/laradock/nginx# docker-compose down
$root@midascode:~/laravel/laradock/nginx# docker-compose build nginx
```
#### Re Run Your Containers MYSQL and NGINX
```
$root@midascode:~/laravel/laradock/nginx# docker-compose up -d nginx mysql
```
###### 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
```
$root@midascode:~/laravel/laradock# cd caddy
$root@midascode:~/laravel/laradock/caddy# vim Caddyfile
```
Remove 0.0.0.0:80
```
0.0.0.0:80
root /var/www/laravel/public
```
and replace with your https://yourdomain.com
```
https://yourdomain.com
root /var/www/laravel/public
```
uncomment tls
```
#tls self-signed
```
and replace self-signed with your email address
```
tls midascodebreaker@gmai.com
```
This is needed Prior to Creating Let's Encypt
#### Run Your Caddy Container without the -d flag and Generate SSL with Let's Encrypt
```
$root@midascode:~/laravel/laradock/caddy# docker-compose up caddy
```
you will be prompt here to enter your email... you may enter it or not
```
Attaching to laradock_mysql_1, laradock_caddy_1
caddy_1 | Activating privacy features...
caddy_1 | Your sites will be served over HTTPS automatically using Let's Encrypt.
caddy_1 | By continuing, you agree to the Let's Encrypt Subscriber Agreement at:
caddy_1 | https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf
caddy_1 | Activating privacy features... done.
caddy_1 | https://yourdomain.com
caddy_1 | http://yourdomain.com
```
After it finish Press Ctrl + C to exit ...
#### Stop All Containers and ReRun Caddy and Other Containers on Background
```
$root@midascode:~/laravel/laradock/caddy# docker-compose down
$root@midascode:~/laravel/laradock/caddy# docker-compose up -d mysql caddy
```
View your Site in the Browser Securely Using HTTPS (https://yourdomain.com)
##### Note that Certificate will be Automatically Renew By Caddy
>References:
>
- [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04](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://www.digitalocean.com/products/one-click-apps/docker/)
- [https://docs.docker.com/engine/installation/linux/ubuntulinux/](https://docs.docker.com/engine/installation/linux/ubuntulinux/)
- [https://docs.docker.com/compose/install/](https://docs.docker.com/compose/install/)
- [https://caddyserver.com/docs/automatic-https](https://caddyserver.com/docs/automatic-https)
- [https://caddyserver.com/docs/tls](https://caddyserver.com/docs/tls)
- [https://caddyserver.com/docs/caddyfile](https://caddyserver.com/docs/caddyfile)
@ -1086,7 +876,9 @@ View your Site in the Browser Securely Using HTTPS (https://yourdomain.com)
<br> <br>
<a name="Misc"></a> <a name="Misc"></a>
### [Misc]
<br> <br>
@ -1239,7 +1031,7 @@ Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requ
This little project was built by one man who has a full time job and many responsibilities, so if you like this project and you find that it needs a bug fix or support for new software or upgrade any container, or anything else.. Do not hesitate to contribute, you are more than welcome :) This little project was built by one man who has a full time job and many responsibilities, so if you like this project and you find that it needs a bug fix or support for new software or upgrade any container, or anything else.. Do not hesitate to contribute, you are more than welcome :)
#### Read our [Contribution Guidelines](https://github.com/LaraDock/laradock/blob/master/CONTRIBUTING.md) #### Read our [Contribution Guidelines](https://github.com/LaraDock/laradock/blob/master/_guides/contributing.md)
<a name="Help"></a> <a name="Help"></a>
## Help & Questions ## Help & Questions
@ -1258,6 +1050,7 @@ For special help with Docker and/or Laravel, you can schedule a live call with t
**Main Contributors:** **Main Contributors:**
- [MidasCodeBreaker](https://github.com/midascodebreaker)
- [Larry Eitel (LarryEitel)](https://github.com/LarryEitel) - [Larry Eitel (LarryEitel)](https://github.com/LarryEitel)
- [Suteepat (tianissimo)](https://github.com/tianissimo) - [Suteepat (tianissimo)](https://github.com/tianissimo)
- [David (davidavz)](https://github.com/davidavz) - [David (davidavz)](https://github.com/davidavz)

View File

@ -1,5 +1,3 @@
# Contributing to LaraDock # Contributing to LaraDock
Your contribution is more than welcome. Let's keep LaraDock amazing. Your contribution is more than welcome. Let's keep LaraDock amazing.

214
_guides/digital_ocean.md Normal file
View File

@ -0,0 +1,214 @@
#### Install Docker
```
Login Digital Ocean
Add Droplet
1 Click Install docker
Choose Droplet
reset ROOT password
check email
```
#### SSH to your Server
```
ssh root@ipaddress
```
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
```
$root@midascode:~# docker
```
#### Set Up Your Laravel Project
```
$root@midascode:~# apt-get install git
$root@midascode:~# git clone https://github.com/laravel/laravel
$root@midascode:~# cd laravel
$root@midascode:~/laravel# git checkout develop
$root@midascode:~/laravel/ git submodule add https://github.com/LaraDock/laradock.git
$root@midascode:~/laravel/ cd laradock
```
#### Install docker-compose command
```
$root@midascode:~/laravel/laradock# curl -L https://github.com/docker/compose/releases/download/1.8.0/run.sh > /usr/local/bin/docker-compose
$root@midascode:~/chmod +x /usr/local/bin/docker-compose
```
#### Create Your LaraDock Containers
```
$root@midascode:~/laravel/laradock# docker-compose up -d nginx mysql
```
#### Go to Your Workspace
```
docker-compose exec workspace bash
```
#### Install laravel Dependencies, Add .env , generate Key and give proper permission certain folder
```
$ root@0e77851d27d3:/var/www/laravel# composer install
$ root@0e77851d27d3:/var/www/laravel# cp .env.example .env
$ root@0e77851d27d3:/var/www/laravel# php artisan key:generate
$ root@0e77851d27d3:/var/www/laravel# exit
$root@midascode:~/laravel/laradock# cd ..
$root@midascode:~/laravel# sudo chmod -R 777 storage bootstrap/cache
```
you can then view your laravel site at your ipaddress
for example
```
192.168.1.1
```
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
```
ns1.digitalocean.com
ns2.digitalocean.com
ns3.digitalocean.com
```
In Your Digital Ocean Account go to
```
https://cloud.digitalocean.com/networking/domains
```
add your domain name and choose the server ip you provision earlier
#### Serve Site With NGINX (HTTP ONLY)
Go back to command line
```
$root@midascode:~/laravel/laradock# cd nginx
$root@midascode:~/laravel/laradock/nginx# vim laravel.conf
```
remove default_server
```
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
```
and add server_name (your custom domain)
```
listen 80;
listen [::]:80 ipv6only=on;
server_name yourdomain.com;
```
#### Rebuild Your Nginx
```
$root@midascode:~/laravel/laradock/nginx# docker-compose down
$root@midascode:~/laravel/laradock/nginx# docker-compose build nginx
```
#### Re Run Your Containers MYSQL and NGINX
```
$root@midascode:~/laravel/laradock/nginx# docker-compose up -d nginx mysql
```
###### 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
```
$root@midascode:~/laravel/laradock# cd caddy
$root@midascode:~/laravel/laradock/caddy# vim Caddyfile
```
Remove 0.0.0.0:80
```
0.0.0.0:80
root /var/www/laravel/public
```
and replace with your https://yourdomain.com
```
https://yourdomain.com
root /var/www/laravel/public
```
uncomment tls
```
#tls self-signed
```
and replace self-signed with your email address
```
tls midascodebreaker@gmai.com
```
This is needed Prior to Creating Let's Encypt
#### Run Your Caddy Container without the -d flag and Generate SSL with Let's Encrypt
```
$root@midascode:~/laravel/laradock/caddy# docker-compose up caddy
```
you will be prompt here to enter your email... you may enter it or not
```
Attaching to laradock_mysql_1, laradock_caddy_1
caddy_1 | Activating privacy features...
caddy_1 | Your sites will be served over HTTPS automatically using Let's Encrypt.
caddy_1 | By continuing, you agree to the Let's Encrypt Subscriber Agreement at:
caddy_1 | https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf
caddy_1 | Activating privacy features... done.
caddy_1 | https://yourdomain.com
caddy_1 | http://yourdomain.com
```
After it finish Press Ctrl + C to exit ...
#### Stop All Containers and ReRun Caddy and Other Containers on Background
```
$root@midascode:~/laravel/laradock/caddy# docker-compose down
$root@midascode:~/laravel/laradock/caddy# docker-compose up -d mysql caddy
```
View your Site in the Browser Securely Using HTTPS (https://yourdomain.com)
##### Note that Certificate will be Automatically Renew By Caddy
>References:
>
- [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04](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://www.digitalocean.com/products/one-click-apps/docker/)
- [https://docs.docker.com/engine/installation/linux/ubuntulinux/](https://docs.docker.com/engine/installation/linux/ubuntulinux/)
- [https://docs.docker.com/compose/install/](https://docs.docker.com/compose/install/)
- [https://caddyserver.com/docs/automatic-https](https://caddyserver.com/docs/automatic-https)
- [https://caddyserver.com/docs/tls](https://caddyserver.com/docs/tls)
- [https://caddyserver.com/docs/caddyfile](https://caddyserver.com/docs/caddyfile)