Reverting unintended MD formatting
This commit is contained in:
parent
47150da482
commit
9413f2c86f
|
@ -4,32 +4,34 @@ type: index
|
||||||
weight: 2
|
weight: 2
|
||||||
---
|
---
|
||||||
|
|
||||||
# Requirements
|
## Requirements
|
||||||
|
|
||||||
- [Git](https://git-scm.com/downloads)
|
- [Git](https://git-scm.com/downloads)
|
||||||
- [Docker](https://www.docker.com/products/docker/) `>= 1.12`
|
- [Docker](https://www.docker.com/products/docker/) `>= 1.12`
|
||||||
|
|
||||||
# Installation
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
Choose the setup the best suits your needs.
|
Choose the setup the best suits your needs.
|
||||||
|
|
||||||
- [A) Setup for Single Project](#A)
|
- [A) Setup for Single Project](#A)
|
||||||
|
|
||||||
- [A.1) Already have a PHP project](#A1)
|
- [A.1) Already have a PHP project](#A1)
|
||||||
|
|
||||||
- [A.2) Don't have a PHP project yet](#A2)
|
- [A.2) Don't have a PHP project yet](#A2)
|
||||||
|
|
||||||
- [B) Setup for Multiple Projects](#B)
|
- [B) Setup for Multiple Projects](#B)
|
||||||
|
|
||||||
[]()
|
|
||||||
|
|
||||||
## A) Setup for Single Project
|
|
||||||
|
|
||||||
|
<a name="A"></a>
|
||||||
|
### A) Setup for Single Project
|
||||||
> (Follow these steps if you want a separate Docker environment for each project)
|
> (Follow these steps if you want a separate Docker environment for each project)
|
||||||
|
|
||||||
[]()
|
|
||||||
|
|
||||||
## A.1) Already have a PHP project:
|
<a name="A1"></a>
|
||||||
|
### A.1) Already have a PHP project:
|
||||||
|
|
||||||
1 - Clone laradock on your project root directory:
|
1 - Clone laradock on your project root directory:
|
||||||
|
|
||||||
|
@ -39,7 +41,8 @@ git submodule add https://github.com/Laradock/laradock.git
|
||||||
|
|
||||||
Note: If you are not using Git yet for your project, you can use `git clone` instead of `git submodule `.
|
Note: If you are not using Git yet for your project, you can use `git clone` instead of `git submodule `.
|
||||||
|
|
||||||
_To keep track of your Laradock changes, between your projects and also keep Laradock updated [check these docs](/documentation/#keep-track-of-your-laradock-changes)_
|
*To keep track of your Laradock changes, between your projects and also keep Laradock updated [check these docs](/documentation/#keep-track-of-your-laradock-changes)*
|
||||||
|
|
||||||
|
|
||||||
Your folder structure should look like this:
|
Your folder structure should look like this:
|
||||||
|
|
||||||
|
@ -50,13 +53,12 @@ Your folder structure should look like this:
|
||||||
+ laradock-b
|
+ laradock-b
|
||||||
```
|
```
|
||||||
|
|
||||||
_(It's important to rename the laradock folders to unique name in each project, if you want to run laradock per project)._
|
*(It's important to rename the laradock folders to unique name in each project, if you want to run laradock per project).*
|
||||||
|
|
||||||
> **Now jump to the [Usage](#Usage) section.**
|
> **Now jump to the [Usage](#Usage) section.**
|
||||||
|
|
||||||
[]()
|
<a name="A2"></a>
|
||||||
|
### A.2) Don't have a PHP project yet:
|
||||||
## A.2) Don't have a PHP project yet:
|
|
||||||
|
|
||||||
1 - Clone this repository anywhere on your machine:
|
1 - Clone this repository anywhere on your machine:
|
||||||
|
|
||||||
|
@ -89,13 +91,12 @@ Make sure to replace `project-z` with your project folder name.
|
||||||
|
|
||||||
> **Now jump to the [Usage](#Usage) section.**
|
> **Now jump to the [Usage](#Usage) section.**
|
||||||
|
|
||||||
[]()
|
|
||||||
|
|
||||||
## B) Setup for Multiple Projects:
|
|
||||||
|
|
||||||
|
<a name="B"></a>
|
||||||
|
### B) Setup for Multiple Projects:
|
||||||
> (Follow these steps if you want a single Docker environment for all your project)
|
> (Follow these steps if you want a single Docker environment for all your project)
|
||||||
|
|
||||||
1 - Clone this repository anywhere on your machine (similar to [Steps A.2\. from above](#A2)):
|
1 - Clone this repository anywhere on your machine (similar to [Steps A.2. from above](#A2)):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/laradock/laradock.git
|
git clone https://github.com/laradock/laradock.git
|
||||||
|
@ -126,16 +127,21 @@ You can rename the config files, project folders and domains as you like, just m
|
||||||
|
|
||||||
> **Now jump to the [Usage](#Usage) section.**
|
> **Now jump to the [Usage](#Usage) section.**
|
||||||
|
|
||||||
[]()
|
|
||||||
|
|
||||||
# Usage
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="Usage"></a>
|
||||||
|
## Usage
|
||||||
|
|
||||||
**Read Before starting:**
|
**Read Before starting:**
|
||||||
|
|
||||||
If you are using **Docker Toolbox** (VM), do one of the following:
|
If you are using **Docker Toolbox** (VM), do one of the following:
|
||||||
|
|
||||||
- Upgrade to Docker [Native](https://www.docker.com/products/docker) for Mac/Windows (Recommended). Check out [Upgrading Laradock](/documentation/#upgrading-laradock)
|
- Upgrade to Docker [Native](https://www.docker.com/products/docker) for Mac/Windows (Recommended). Check out [Upgrading Laradock](/documentation/#upgrading-laradock)
|
||||||
- Use Laradock v3.*. Visit the [Laradock-ToolBox](https://github.com/laradock/laradock/tree/Laradock-ToolBox) branch. _(outdated)_
|
- Use Laradock v3.\*. Visit the [Laradock-ToolBox](https://github.com/laradock/laradock/tree/Laradock-ToolBox) branch. *(outdated)*
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
@ -151,6 +157,7 @@ cp env-example .env
|
||||||
|
|
||||||
You can edit the `.env` file to chose which software's you want to be installed in your environment. You can always refer to the `docker-compose.yml` file to see how those variables are been used.
|
You can edit the `.env` file to chose which software's you want to be installed in your environment. You can always refer to the `docker-compose.yml` file to see how those variables are been used.
|
||||||
|
|
||||||
|
|
||||||
2 - Build the enviroment and run it using `docker-compose`
|
2 - Build the enviroment and run it using `docker-compose`
|
||||||
|
|
||||||
In this example we'll see how to run NGINX (web server) and MySQL (database engine) to host a PHP Web Scripts:
|
In this example we'll see how to run NGINX (web server) and MySQL (database engine) to host a PHP Web Scripts:
|
||||||
|
@ -161,9 +168,11 @@ docker-compose up -d nginx mysql
|
||||||
|
|
||||||
**Note**: The `workspace` and `php-fpm` will run automatically in most of the cases, so no need to specify them in the `up` command. If you couldn't find them running then you need specify them as follow: `docker-compose up -d nginx php-fpm mysql workspace`.
|
**Note**: The `workspace` and `php-fpm` will run automatically in most of the cases, so no need to specify them in the `up` command. If you couldn't find them running then you need specify them as follow: `docker-compose up -d nginx php-fpm mysql workspace`.
|
||||||
|
|
||||||
|
|
||||||
You can select your own combination of containers form [this list](http://laradock.io/introduction/#supported-software-images).
|
You can select your own combination of containers form [this list](http://laradock.io/introduction/#supported-software-images).
|
||||||
|
|
||||||
_(Please note that sometimes we forget to update the docs, so check the `docker-compose.yml` file to see an updated list of all available containers)._
|
*(Please note that sometimes we forget to update the docs, so check the `docker-compose.yml` file to see an updated list of all available containers).*
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, ...)
|
3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, ...)
|
||||||
|
@ -172,7 +181,7 @@ _(Please note that sometimes we forget to update the docs, so check the `docker-
|
||||||
docker-compose exec workspace bash
|
docker-compose exec workspace bash
|
||||||
```
|
```
|
||||||
|
|
||||||
_Alternatively, for Windows PowerShell users: execute the following command to enter any running container:_
|
*Alternatively, for Windows PowerShell users: execute the following command to enter any running container:*
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker exec -it {workspace-container-id} bash
|
docker exec -it {workspace-container-id} bash
|
||||||
|
@ -184,7 +193,7 @@ docker exec -it {workspace-container-id} bash
|
||||||
docker-compose exec --user=laradock workspace bash
|
docker-compose exec --user=laradock workspace bash
|
||||||
```
|
```
|
||||||
|
|
||||||
_You can change the PUID (User id) and PGID (group id) variables from the `.env` file)_
|
*You can change the PUID (User id) and PGID (group id) variables from the `.env` file)*
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
4 - Update your project configurations to use the database host
|
4 - Update your project configurations to use the database host
|
||||||
|
@ -195,7 +204,9 @@ Open your PHP project's `.env` file or whichever configuration file you are read
|
||||||
DB_HOST=mysql
|
DB_HOST=mysql
|
||||||
```
|
```
|
||||||
|
|
||||||
_If you want to install Laravel as PHP project, see [How to Install Laravel in a Docker Container](#Install-Laravel)._
|
*If you want to install Laravel as PHP project, see [How to Install Laravel in a Docker Container](#Install-Laravel).*
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
5 - Open your browser and visit your localhost address `http://localhost/`. If you followed the multiple projects setup, you can visit `http://project-1.dev/` and `http://project-2.dev/`. But first don't
|
5 - Open your browser and visit your localhost address `http://localhost/`. If you followed the multiple projects setup, you can visit `http://project-1.dev/` and `http://project-2.dev/`. But first don't
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,14 @@ type: index
|
||||||
weight: 4
|
weight: 4
|
||||||
---
|
---
|
||||||
|
|
||||||
- [Production Setup on Digital Ocean](#Digital-Ocean)
|
|
||||||
- [PHPStorm XDebug Setup](#PHPStorm-Debugging)
|
|
||||||
|
|
||||||
[]()
|
|
||||||
|
|
||||||
|
* [Production Setup on Digital Ocean](#Digital-Ocean)
|
||||||
|
* [PHPStorm XDebug Setup](#PHPStorm-Debugging)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="Digital-Ocean"></a>
|
||||||
# Production Setup on Digital Ocean
|
# Production Setup on Digital Ocean
|
||||||
|
|
||||||
## Install Docker
|
## Install Docker
|
||||||
|
@ -104,7 +107,7 @@ ns3.digitalocean.com
|
||||||
|
|
||||||
Within DigitalOcean, you'll need to change some settings, too.
|
Within DigitalOcean, you'll need to change some settings, too.
|
||||||
|
|
||||||
Visit: <https://cloud.digitalocean.com/networking/domains>
|
Visit: https://cloud.digitalocean.com/networking/domains
|
||||||
|
|
||||||
Add your domain name and choose the server IP you'd provision earlier.
|
Add your domain name and choose the server IP you'd provision earlier.
|
||||||
|
|
||||||
|
@ -145,7 +148,7 @@ $root@server:~/laravel/laradock/nginx# docker-compose build nginx
|
||||||
$root@server:~/laravel/laradock/nginx# docker-compose up -d nginx mysql
|
$root@server:~/laravel/laradock/nginx# docker-compose up -d nginx mysql
|
||||||
```
|
```
|
||||||
|
|
||||||
**View Your Site with HTTP ONLY (<http://yourdomain.com>)**
|
**View Your Site with HTTP ONLY (http://yourdomain.com)**
|
||||||
|
|
||||||
## Run Site on SSL with Let's Encrypt Certificate
|
## Run Site on SSL with Let's Encrypt Certificate
|
||||||
|
|
||||||
|
@ -165,7 +168,7 @@ Remove 0.0.0.0:80
|
||||||
root /var/www/public
|
root /var/www/public
|
||||||
```
|
```
|
||||||
|
|
||||||
and replace with your <https://yourdomain.com>
|
and replace with your https://yourdomain.com
|
||||||
|
|
||||||
```
|
```
|
||||||
https://yourdomain.com
|
https://yourdomain.com
|
||||||
|
@ -214,93 +217,83 @@ $root@server:~/laravel/laradock/caddy# docker-compose down
|
||||||
$root@server:~/laravel/laradock/caddy# docker-compose up -d mysql caddy
|
$root@server:~/laravel/laradock/caddy# docker-compose up -d mysql caddy
|
||||||
```
|
```
|
||||||
|
|
||||||
View your Site in the Browser Securely Using HTTPS (<https://yourdomain.com>)
|
View your Site in the Browser Securely Using HTTPS (https://yourdomain.com)
|
||||||
|
|
||||||
**Note that Certificate will be Automatically Renew By Caddy**
|
**Note that Certificate will be Automatically Renew By Caddy**
|
||||||
|
|
||||||
>References:
|
>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)
|
||||||
|
|
||||||
> - <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>
|
|
||||||
|
|
||||||
<br><br><br><br><br>
|
|
||||||
|
|
||||||
[]()
|
|
||||||
|
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<a name="PHPStorm-Debugging"></a>
|
||||||
# PHPStorm XDebug Setup
|
# PHPStorm XDebug Setup
|
||||||
|
|
||||||
- [Intro](#Intro)
|
- [Intro](#Intro)
|
||||||
- [Installation](#Installation)
|
- [Installation](#Installation)
|
||||||
|
|
||||||
- [Customize laradock/docker-compose.yml](#CustomizeDockerCompose)
|
- [Customize laradock/docker-compose.yml](#CustomizeDockerCompose)
|
||||||
|
|
||||||
- [Clean House](#InstallCleanHouse)
|
- [Clean House](#InstallCleanHouse)
|
||||||
- [Laradock Dial Tone](#InstallLaradockDialTone)
|
- [Laradock Dial Tone](#InstallLaradockDialTone)
|
||||||
- [hosts](#AddToHosts)
|
- [hosts](#AddToHosts)
|
||||||
- [Firewall](#FireWall)
|
- [Firewall](#FireWall)
|
||||||
- [Enable xDebug on php-fpm](#enablePhpXdebug)
|
- [Enable xDebug on php-fpm](#enablePhpXdebug)
|
||||||
|
|
||||||
- [PHPStorm Settings](#InstallPHPStorm)
|
- [PHPStorm Settings](#InstallPHPStorm)
|
||||||
|
|
||||||
- [Configs](#InstallPHPStormConfigs)
|
- [Configs](#InstallPHPStormConfigs)
|
||||||
|
|
||||||
- [Usage](#Usage)
|
- [Usage](#Usage)
|
||||||
|
|
||||||
- [Laravel](#UsageLaravel)
|
- [Laravel](#UsageLaravel)
|
||||||
|
|
||||||
- [Run ExampleTest](#UsagePHPStormRunExampleTest)
|
- [Run ExampleTest](#UsagePHPStormRunExampleTest)
|
||||||
- [Debug ExampleTest](#UsagePHPStormDebugExampleTest)
|
- [Debug ExampleTest](#UsagePHPStormDebugExampleTest)
|
||||||
- [Debug Web Site](#UsagePHPStormDebugSite)
|
- [Debug Web Site](#UsagePHPStormDebugSite)
|
||||||
|
|
||||||
- [SSH into workspace](#SSHintoWorkspace)
|
- [SSH into workspace](#SSHintoWorkspace)
|
||||||
|
|
||||||
- [KiTTY](#InstallKiTTY)
|
- [KiTTY](#InstallKiTTY)
|
||||||
|
|
||||||
[]()
|
<a name="Intro"></a>
|
||||||
|
|
||||||
## Intro
|
## Intro
|
||||||
|
|
||||||
Wiring up [Laravel](https://laravel.com/), [Laradock](https://github.com/Laradock/laradock) [Laravel+Docker] and [PHPStorm](https://www.jetbrains.com/phpstorm/) to play nice together complete with remote xdebug'ing as icing on top! Although this guide is based on `PHPStorm Windows`, you should be able to adjust accordingly. This guide was written based on Docker for Windows Native.
|
Wiring up [Laravel](https://laravel.com/), [Laradock](https://github.com/Laradock/laradock) [Laravel+Docker] and [PHPStorm](https://www.jetbrains.com/phpstorm/) to play nice together complete with remote xdebug'ing as icing on top! Although this guide is based on `PHPStorm Windows`,
|
||||||
|
you should be able to adjust accordingly. This guide was written based on Docker for Windows Native.
|
||||||
[]()
|
|
||||||
|
|
||||||
|
<a name="Installation"></a>
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
- This guide assumes the following:
|
- This guide assumes the following:
|
||||||
|
|
||||||
- you have already installed and are familiar with Laravel, Laradock and PHPStorm.
|
- you have already installed and are familiar with Laravel, Laradock and PHPStorm.
|
||||||
- you have installed Laravel as a parent of `laradock`. This guide assumes `/c/_dk/laravel`.
|
- you have installed Laravel as a parent of `laradock`. This guide assumes `/c/_dk/laravel`.
|
||||||
|
|
||||||
[]()
|
<a name="AddToHosts"></a>
|
||||||
|
|
||||||
## hosts
|
## hosts
|
||||||
|
- Add `laravel` to your hosts file located on Windows 10 at `C:\Windows\System32\drivers\etc\hosts`. It should be set to the IP of your running container. Mine is: `10.0.75.2`
|
||||||
- Add `laravel` to your hosts file located on Windows 10 at `C:\Windows\System32\drivers\etc\hosts`. It should be set to the IP of your running container. Mine is: `10.0.75.2` On Windows you can find it by opening Windows `Hyper-V Manager`.
|
On Windows you can find it by opening Windows `Hyper-V Manager`.
|
||||||
|
|
||||||
- ![Windows Hyper-V Manager](images/photos/PHPStorm/Settings/WindowsHyperVManager.png)
|
- ![Windows Hyper-V Manager](images/photos/PHPStorm/Settings/WindowsHyperVManager.png)
|
||||||
|
|
||||||
- [Hosts File Editor](https://github.com/scottlerch/HostsFileEditor) makes it easy to change your hosts file.
|
- [Hosts File Editor](https://github.com/scottlerch/HostsFileEditor) makes it easy to change your hosts file.
|
||||||
|
|
||||||
- Set `laravel` to your docker host IP. See [Example](images/photos/SimpleHostsEditor/AddHost_laravel.png).
|
- Set `laravel` to your docker host IP. See [Example](images/photos/SimpleHostsEditor/AddHost_laravel.png).
|
||||||
|
|
||||||
[]()
|
|
||||||
|
|
||||||
|
<a name="FireWall"></a>
|
||||||
## Firewall
|
## Firewall
|
||||||
|
Your PHPStorm will need to be able to receive a connection from PHP xdebug either your running workspace or php-fpm containers on port 9000. This means that your Windows Firewall should either enable connections from the Application PHPStorm OR the port.
|
||||||
Your PHPStorm will need to be able to receive a connection from PHP xdebug either your running workspace or php-fpm containers on port 9000\. This means that your Windows Firewall should either enable connections from the Application PHPStorm OR the port.
|
|
||||||
|
|
||||||
- It is important to note that if the Application PHPStorm is NOT enabled in the firewall, you will not be able to recreate a rule to override that.
|
- It is important to note that if the Application PHPStorm is NOT enabled in the firewall, you will not be able to recreate a rule to override that.
|
||||||
- Also be aware that if you are installing/upgrade different versions of PHPStorm, you MAY have orphaned references to PHPStorm in your Firewall! You may decide to remove orphaned references however in either case, make sure that they are set to receive public TCP traffic.
|
- Also be aware that if you are installing/upgrade different versions of PHPStorm, you MAY have orphaned references to PHPStorm in your Firewall! You may decide to remove orphaned references however in either case, make sure that they are set to receive public TCP traffic.
|
||||||
|
|
||||||
### Edit laradock/docker-compose.yml
|
### Edit laradock/docker-compose.yml
|
||||||
|
|
||||||
Set the following variables:
|
Set the following variables:
|
||||||
|
|
||||||
```
|
```
|
||||||
### Workspace Utilities Container ###############
|
### Workspace Utilities Container ###############
|
||||||
|
|
||||||
|
@ -321,15 +314,14 @@ Set the following variables:
|
||||||
args:
|
args:
|
||||||
- INSTALL_XDEBUG=true
|
- INSTALL_XDEBUG=true
|
||||||
...
|
...
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Edit xdebug.ini files
|
### Edit xdebug.ini files
|
||||||
|
|
||||||
- `laradock/workspace/xdebug.ini`
|
- `laradock/workspace/xdebug.ini`
|
||||||
- `laradock/php-fpm/xdebug.ini`
|
- `laradock/php-fpm/xdebug.ini`
|
||||||
|
|
||||||
Set the following variables:
|
Set the following variables:
|
||||||
|
|
||||||
```
|
```
|
||||||
xdebug.remote_autostart=1
|
xdebug.remote_autostart=1
|
||||||
xdebug.remote_enable=1
|
xdebug.remote_enable=1
|
||||||
|
@ -337,18 +329,22 @@ xdebug.remote_connect_back=1
|
||||||
xdebug.cli_color=1
|
xdebug.cli_color=1
|
||||||
```
|
```
|
||||||
|
|
||||||
[]()
|
|
||||||
|
|
||||||
|
<a name="InstallCleanHouse"></a>
|
||||||
### Need to clean house first?
|
### Need to clean house first?
|
||||||
|
Make sure you are starting with a clean state. For example, do you have other Laradock containers and images?
|
||||||
|
Here are a few things I use to clean things up.
|
||||||
|
|
||||||
Make sure you are starting with a clean state. For example, do you have other Laradock containers and images? Here are a few things I use to clean things up.
|
- Delete all containers using `grep laradock_` on the names, see: [Remove all containers based on docker image name](https://linuxconfig.org/remove-all-containners-based-on-docker-image-name).
|
||||||
|
`docker ps -a | awk '{ print $1,$2 }' | grep laradock_ | awk '{print $1}' | xargs -I {} docker rm {}`
|
||||||
|
|
||||||
- Delete all containers using `grep laradock_` on the names, see: [Remove all containers based on docker image name](https://linuxconfig.org/remove-all-containners-based-on-docker-image-name). `docker ps -a | awk '{ print $1,$2 }' | grep laradock_ | awk '{print $1}' | xargs -I {} docker rm {}`
|
- Delete all images containing `laradock`.
|
||||||
|
`docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {}`
|
||||||
- Delete all images containing `laradock`. `docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {}` **Note:** This will only delete images that were built with `Laradock`, **NOT** `laradock/*` which are pulled down by `Laradock` such as `laradock/workspace`, etc. **Note:** Some may fail with: `Error response from daemon: conflict: unable to delete 3f38eaed93df (cannot be forced) - image has dependent child images`
|
**Note:** This will only delete images that were built with `Laradock`, **NOT** `laradock/*` which are pulled down by `Laradock` such as `laradock/workspace`, etc.
|
||||||
|
**Note:** Some may fail with:
|
||||||
|
`Error response from daemon: conflict: unable to delete 3f38eaed93df (cannot be forced) - image has dependent child images`
|
||||||
|
|
||||||
- I added this to my `.bashrc` to remove orphaned images.
|
- I added this to my `.bashrc` to remove orphaned images.
|
||||||
|
|
||||||
```
|
```
|
||||||
dclean() {
|
dclean() {
|
||||||
processes=`docker ps -q -f status=exited`
|
processes=`docker ps -q -f status=exited`
|
||||||
|
@ -364,7 +360,6 @@ Make sure you are starting with a clean state. For example, do you have other La
|
||||||
```
|
```
|
||||||
|
|
||||||
- If you frequently switch configurations for Laradock, you may find that adding the following and added to your `.bashrc` or equivalent useful:
|
- If you frequently switch configurations for Laradock, you may find that adding the following and added to your `.bashrc` or equivalent useful:
|
||||||
|
|
||||||
```
|
```
|
||||||
# remove laravel* containers
|
# remove laravel* containers
|
||||||
# remove laravel_* images
|
# remove laravel_* images
|
||||||
|
@ -388,8 +383,7 @@ Make sure you are starting with a clean state. For example, do you have other La
|
||||||
alias dcleanlaradock=dcleanlaradockfunction
|
alias dcleanlaradock=dcleanlaradockfunction
|
||||||
```
|
```
|
||||||
|
|
||||||
[]()
|
<a name="InstallLaradockDialTone"></a>
|
||||||
|
|
||||||
## Let's get a dial-tone with Laravel
|
## Let's get a dial-tone with Laravel
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -408,14 +402,14 @@ laradock_php-fpm_1 php-fpm Up 9000/tcp
|
||||||
laradock_volumes_data_1 true Exit 0
|
laradock_volumes_data_1 true Exit 0
|
||||||
laradock_volumes_source_1 true Exit 0
|
laradock_volumes_source_1 true Exit 0
|
||||||
laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222->22/tcp
|
laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222->22/tcp
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
[]()
|
<a name="enablePhpXdebug"></a>
|
||||||
|
|
||||||
## Enable xDebug on php-fpm
|
## Enable xDebug on php-fpm
|
||||||
|
In a host terminal sitting in the laradock folder, run: `.php-fpm/xdebug status`
|
||||||
In a host terminal sitting in the laradock folder, run: `.php-fpm/xdebug status` You should see something like the following:
|
You should see something like the following:
|
||||||
|
|
||||||
```
|
```
|
||||||
xDebug status
|
xDebug status
|
||||||
laradock_php-fpm_1
|
laradock_php-fpm_1
|
||||||
|
@ -424,144 +418,121 @@ Copyright (c) 1997-2016 The PHP Group
|
||||||
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
|
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
|
||||||
with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans
|
with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans
|
||||||
```
|
```
|
||||||
|
|
||||||
Other commands include `.php-fpm/xdebug start | stop`.
|
Other commands include `.php-fpm/xdebug start | stop`.
|
||||||
|
|
||||||
If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will already be running when `php-fpm` is started and listening for debug info on port 9000.
|
If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will already be running when
|
||||||
|
`php-fpm` is started and listening for debug info on port 9000.
|
||||||
|
|
||||||
[]()
|
|
||||||
|
|
||||||
|
<a name="InstallPHPStormConfigs"></a>
|
||||||
## PHPStorm Settings
|
## PHPStorm Settings
|
||||||
|
|
||||||
- Here are some settings that are known to work:
|
- Here are some settings that are known to work:
|
||||||
|
|
||||||
- `Settings/BuildDeploymentConnection`
|
- `Settings/BuildDeploymentConnection`
|
||||||
|
|
||||||
- ![Settings/BuildDeploymentConnection](/images/photos/PHPStorm/Settings/BuildDeploymentConnection.png)
|
- ![Settings/BuildDeploymentConnection](/images/photos/PHPStorm/Settings/BuildDeploymentConnection.png)
|
||||||
|
|
||||||
- `Settings/BuildDeploymentConnectionMappings`
|
- `Settings/BuildDeploymentConnectionMappings`
|
||||||
|
|
||||||
- ![Settings/BuildDeploymentConnectionMappings](/images/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png)
|
- ![Settings/BuildDeploymentConnectionMappings](/images/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png)
|
||||||
|
|
||||||
- `Settings/BuildDeploymentDebugger`
|
- `Settings/BuildDeploymentDebugger`
|
||||||
|
|
||||||
- ![Settings/BuildDeploymentDebugger](/images/photos/PHPStorm/Settings/BuildDeploymentDebugger.png)
|
- ![Settings/BuildDeploymentDebugger](/images/photos/PHPStorm/Settings/BuildDeploymentDebugger.png)
|
||||||
|
|
||||||
- `Settings/EditRunConfigurationRemoteWebDebug`
|
- `Settings/EditRunConfigurationRemoteWebDebug`
|
||||||
|
|
||||||
- ![Settings/EditRunConfigurationRemoteWebDebug](/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png)
|
- ![Settings/EditRunConfigurationRemoteWebDebug](/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png)
|
||||||
|
|
||||||
- `Settings/EditRunConfigurationRemoteExampleTestDebug`
|
- `Settings/EditRunConfigurationRemoteExampleTestDebug`
|
||||||
|
|
||||||
- ![Settings/EditRunConfigurationRemoteExampleTestDebug](/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png)
|
- ![Settings/EditRunConfigurationRemoteExampleTestDebug](/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png)
|
||||||
|
|
||||||
- `Settings/LangsPHPDebug`
|
- `Settings/LangsPHPDebug`
|
||||||
|
|
||||||
- ![Settings/LangsPHPDebug](/images/photos/PHPStorm/Settings/LangsPHPDebug.png)
|
- ![Settings/LangsPHPDebug](/images/photos/PHPStorm/Settings/LangsPHPDebug.png)
|
||||||
|
|
||||||
- `Settings/LangsPHPInterpreters`
|
- `Settings/LangsPHPInterpreters`
|
||||||
|
|
||||||
- ![Settings/LangsPHPInterpreters](/images/photos/PHPStorm/Settings/LangsPHPInterpreters.png)
|
- ![Settings/LangsPHPInterpreters](/images/photos/PHPStorm/Settings/LangsPHPInterpreters.png)
|
||||||
|
|
||||||
- `Settings/LangsPHPPHPUnit`
|
- `Settings/LangsPHPPHPUnit`
|
||||||
|
|
||||||
- ![Settings/LangsPHPPHPUnit](/images/photos/PHPStorm/Settings/LangsPHPPHPUnit.png)
|
- ![Settings/LangsPHPPHPUnit](/images/photos/PHPStorm/Settings/LangsPHPPHPUnit.png)
|
||||||
|
|
||||||
- `Settings/LangsPHPServers`
|
- `Settings/LangsPHPServers`
|
||||||
|
|
||||||
- ![Settings/LangsPHPServers](/images/photos/PHPStorm/Settings/LangsPHPServers.png)
|
- ![Settings/LangsPHPServers](/images/photos/PHPStorm/Settings/LangsPHPServers.png)
|
||||||
|
|
||||||
- `RemoteHost` To switch on this view, go to: `Menu/Tools/Deployment/Browse Remote Host`.
|
- `RemoteHost`
|
||||||
|
To switch on this view, go to: `Menu/Tools/Deployment/Browse Remote Host`.
|
||||||
- ![RemoteHost](/images/photos/PHPStorm/RemoteHost.png)
|
- ![RemoteHost](/images/photos/PHPStorm/RemoteHost.png)
|
||||||
|
|
||||||
- `RemoteWebDebug`
|
- `RemoteWebDebug`
|
||||||
|
|
||||||
- ![DebugRemoteOn](/images/photos/PHPStorm/DebugRemoteOn.png)
|
- ![DebugRemoteOn](/images/photos/PHPStorm/DebugRemoteOn.png)
|
||||||
|
|
||||||
- `EditRunConfigurationRemoteWebDebug` Go to: `Menu/Run/Edit Configurations`.
|
- `EditRunConfigurationRemoteWebDebug`
|
||||||
|
Go to: `Menu/Run/Edit Configurations`.
|
||||||
- ![EditRunConfigurationRemoteWebDebug](/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png)
|
- ![EditRunConfigurationRemoteWebDebug](/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png)
|
||||||
|
|
||||||
- `EditRunConfigurationRemoteExampleTestDebug` Go to: `Menu/Run/Edit Configurations`.
|
- `EditRunConfigurationRemoteExampleTestDebug`
|
||||||
|
Go to: `Menu/Run/Edit Configurations`.
|
||||||
- ![EditRunConfigurationRemoteExampleTestDebug](/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png)
|
- ![EditRunConfigurationRemoteExampleTestDebug](/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png)
|
||||||
|
|
||||||
- `WindowsFirewallAllowedApps` Go to: `Control Panel\All Control Panel Items\Windows Firewall\Allowed apps`.
|
- `WindowsFirewallAllowedApps`
|
||||||
|
Go to: `Control Panel\All Control Panel Items\Windows Firewall\Allowed apps`.
|
||||||
- ![WindowsFirewallAllowedApps.png](/images/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png)
|
- ![WindowsFirewallAllowedApps.png](/images/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png)
|
||||||
|
|
||||||
- `hosts` Edit: `C:\Windows\System32\drivers\etc\hosts`.
|
- `hosts`
|
||||||
|
Edit: `C:\Windows\System32\drivers\etc\hosts`.
|
||||||
- ![WindowsFirewallAllowedApps.png](/images/photos/PHPStorm/Settings/hosts.png)
|
- ![WindowsFirewallAllowedApps.png](/images/photos/PHPStorm/Settings/hosts.png)
|
||||||
|
|
||||||
- [Enable xDebug on php-fpm](#enablePhpXdebug)
|
- [Enable xDebug on php-fpm](#enablePhpXdebug)
|
||||||
|
|
||||||
[]()
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="Usage"></a>
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
[]()
|
<a name="UsagePHPStormRunExampleTest"></a>
|
||||||
|
|
||||||
### Run ExampleTest
|
### Run ExampleTest
|
||||||
|
|
||||||
- right-click on `tests/ExampleTest.php`
|
- right-click on `tests/ExampleTest.php`
|
||||||
|
|
||||||
- Select: `Run 'ExampleTest.php'` or `Ctrl+Shift+F10`.
|
- Select: `Run 'ExampleTest.php'` or `Ctrl+Shift+F10`.
|
||||||
- Should pass!! You just ran a remote test via SSH!
|
- Should pass!! You just ran a remote test via SSH!
|
||||||
|
|
||||||
[]()
|
<a name="UsagePHPStormDebugExampleTest"></a>
|
||||||
|
|
||||||
### Debug ExampleTest
|
### Debug ExampleTest
|
||||||
|
|
||||||
- Open to edit: `tests/ExampleTest.php`
|
- Open to edit: `tests/ExampleTest.php`
|
||||||
- Add a BreakPoint on line 16: `$this->visit('/')`
|
- Add a BreakPoint on line 16: `$this->visit('/')`
|
||||||
- right-click on `tests/ExampleTest.php`
|
- right-click on `tests/ExampleTest.php`
|
||||||
|
|
||||||
- Select: `Debug 'ExampleTest.php'`.
|
- Select: `Debug 'ExampleTest.php'`.
|
||||||
- Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH!
|
- Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH!
|
||||||
- ![Remote Test Debugging Success](/images/photos/PHPStorm/RemoteTestDebuggingSuccess.png)
|
- ![Remote Test Debugging Success](/images/photos/PHPStorm/RemoteTestDebuggingSuccess.png)
|
||||||
|
|
||||||
[]()
|
|
||||||
|
|
||||||
|
<a name="UsagePHPStormDebugSite"></a>
|
||||||
### Debug WebSite
|
### Debug WebSite
|
||||||
|
- In case xDebug is disabled, from the `laradock` folder run:
|
||||||
- In case xDebug is disabled, from the `laradock` folder run: `.php-fpm/xdebug start`.
|
`.php-fpm/xdebug start`.
|
||||||
|
- To switch xdebug off, run:
|
||||||
- To switch xdebug off, run: `.php-fpm/xdebug stop`
|
`.php-fpm/xdebug stop`
|
||||||
|
|
||||||
- Start Remote Debugging
|
- Start Remote Debugging
|
||||||
|
|
||||||
- ![DebugRemoteOn](/images/photos/PHPStorm/DebugRemoteOn.png)
|
- ![DebugRemoteOn](/images/photos/PHPStorm/DebugRemoteOn.png)
|
||||||
|
|
||||||
- Open to edit: `bootstrap/app.php`
|
- Open to edit: `bootstrap/app.php`
|
||||||
|
|
||||||
- Add a BreakPoint on line 14: `$app = new Illuminate\Foundation\Application(`
|
- Add a BreakPoint on line 14: `$app = new Illuminate\Foundation\Application(`
|
||||||
- Reload [Laravel Site](http://laravel/)
|
- Reload [Laravel Site](http://laravel/)
|
||||||
|
|
||||||
- Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH!
|
- Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH!
|
||||||
- ![Remote Debugging Success](/images/photos/PHPStorm/RemoteDebuggingSuccess.png)
|
- ![Remote Debugging Success](/images/photos/PHPStorm/RemoteDebuggingSuccess.png)
|
||||||
|
|
||||||
[]()
|
|
||||||
|
|
||||||
|
<a name="SSHintoWorkspace"></a>
|
||||||
## Let's shell into workspace
|
## Let's shell into workspace
|
||||||
|
Assuming that you are in laradock folder, type:
|
||||||
Assuming that you are in laradock folder, type: `ssh -i workspace/insecure_id_rsa -p2222 root@laravel` **Cha Ching!!!!**
|
`ssh -i workspace/insecure_id_rsa -p2222 root@laravel`
|
||||||
|
**Cha Ching!!!!**
|
||||||
- `workspace/insecure_id_rsa.ppk` may become corrupted. In which case:
|
- `workspace/insecure_id_rsa.ppk` may become corrupted. In which case:
|
||||||
|
|
||||||
- fire up `puttygen`
|
- fire up `puttygen`
|
||||||
- import `workspace/insecure_id_rsa`
|
- import `workspace/insecure_id_rsa`
|
||||||
- save private key to `workspace/insecure_id_rsa.ppk`
|
- save private key to `workspace/insecure_id_rsa.ppk`
|
||||||
|
|
||||||
[]()
|
<a name="InstallKiTTY"></a>
|
||||||
|
|
||||||
### KiTTY
|
### KiTTY
|
||||||
|
|
||||||
[Kitty](http://www.9bis.net/kitty/) KiTTY is a fork from version 0.67 of PuTTY.
|
[Kitty](http://www.9bis.net/kitty/) KiTTY is a fork from version 0.67 of PuTTY.
|
||||||
|
|
||||||
- Here are some settings that are working for me:
|
- Here are some settings that are working for me:
|
||||||
|
|
||||||
- ![Session](/images/photos/KiTTY/Session.png)
|
- ![Session](/images/photos/KiTTY/Session.png)
|
||||||
- ![Terminal](/images/photos/KiTTY/Terminal.png)
|
- ![Terminal](/images/photos/KiTTY/Terminal.png)
|
||||||
- ![Window](/images/photos/KiTTY/Window.png)
|
- ![Window](/images/photos/KiTTY/Window.png)
|
||||||
|
@ -571,3 +542,5 @@ Assuming that you are in laradock folder, type: `ssh -i workspace/insecure_id_rs
|
||||||
- ![ConnectionSSH](/images/photos/KiTTY/ConnectionSSH.png)
|
- ![ConnectionSSH](/images/photos/KiTTY/ConnectionSSH.png)
|
||||||
- ![ConnectionSSHAuth](/images/photos/KiTTY/ConnectionSSHAuth.png)
|
- ![ConnectionSSHAuth](/images/photos/KiTTY/ConnectionSSHAuth.png)
|
||||||
- ![TerminalShell](/images/photos/KiTTY/TerminalShell.png)
|
- ![TerminalShell](/images/photos/KiTTY/TerminalShell.png)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue