Compare commits
27 Commits
Author | SHA1 | Date | |
---|---|---|---|
f12028576c | |||
27d3525469 | |||
8b6fdfed76 | |||
3c427d20c0 | |||
57c003722e | |||
ab4c44a434 | |||
0f7969c999 | |||
aa8f7c48a5 | |||
533925522c | |||
48a6c06ebb | |||
537f2c5033 | |||
f36f9ef6ec | |||
605c191717 | |||
f2615b9ff2 | |||
04174b476c | |||
afac432b2f | |||
2f156edafd | |||
42d551dead | |||
b7d38ef7dd | |||
c5ac8d1ada | |||
2f20216d8f | |||
5e0e120950 | |||
33b701afdc | |||
e0c18374df | |||
20adc9ca13 | |||
dd9855d411 | |||
17e252a436 |
130
CONTRIBUTING.md
Normal file
130
CONTRIBUTING.md
Normal file
@ -0,0 +1,130 @@
|
||||
|
||||
|
||||
# Contributing to LaraDock
|
||||
|
||||
Your contribution is more than welcome. Let's keep LaraDock amazing.
|
||||
|
||||
|
||||
### Got a Question or Problem?
|
||||
|
||||
If you have questions about how to use LaraDock, please direct your questions to the discussion on [Gitter](https://gitter.im/LaraDock/laradock). If you beleave your question could help others, then consider opening an [Issue](https://github.com/laradock/laradock/issues) (it will be labeled as Question).
|
||||
|
||||
### Found an Issue?
|
||||
If you find a bug in the source code or a mistake in the documentation, you can help us by
|
||||
submitting an [Issue](https://github.com/laradock/laradock/issues). Even better you can submit a Pull Request with a fix.
|
||||
|
||||
### Want a Feature?
|
||||
You can request a new feature by submitting an [Issue](https://github.com/laradock/laradock/issues) (it will be labeled as Feature Suggestion). If you would like to implement a new feature then consider submitting a Pull Request.
|
||||
|
||||
|
||||
## Coding Guidelines
|
||||
|
||||
### Support new Software
|
||||
|
||||
* Create folder with the software name.
|
||||
|
||||
* Add a `Dockerfile`, write your code there.
|
||||
|
||||
* You may add additional files in the software folder.
|
||||
|
||||
* Add the software to the `docker-compose.yml` file.
|
||||
|
||||
* Make sure you follow our commenting style.
|
||||
|
||||
* Add the software in the `Readme`.
|
||||
|
||||
### Edit existing Software
|
||||
|
||||
* Open the software (container) folder.
|
||||
|
||||
* Edit the files you want to update.
|
||||
|
||||
* **Note:** If you want to edit the base image of the `Workspace` or the `php-fpm` Containers,
|
||||
you need to edit their Dockerfiles from their Github repositories. For more info read their Dockerfiles comment on the LaraDock repository.
|
||||
|
||||
* Make sure to update the `Readme` incase you made any changes.
|
||||
|
||||
## Issue/PR Submission Guidelines
|
||||
|
||||
### Submitting an Issue
|
||||
Before you submit your issue search the archive, maybe your question was already answered.
|
||||
|
||||
If your issue appears to be a bug, and hasn't been reported, open a new issue.
|
||||
Help us to maximize the effort we can spend fixing issues and adding new
|
||||
features, by not reporting duplicate issues.
|
||||
|
||||
|
||||
|
||||
### Submitting a Pull Request (PR)
|
||||
Before you submit your pull request consider the following guidelines:
|
||||
|
||||
* Search [GitHub](https://github.com/LaraDock/laradock/pulls) for an open or closed Pull Request that relates to your submission. You don't want to duplicate effort.
|
||||
|
||||
* Make your changes in a new git branch:
|
||||
|
||||
```shell
|
||||
git checkout -b my-fix-branch master
|
||||
```
|
||||
* Commit your changes using a descriptive commit message.
|
||||
|
||||
* Push your branch to GitHub:
|
||||
|
||||
```shell
|
||||
git push origin my-fix-branch
|
||||
```
|
||||
|
||||
* In GitHub, send a pull request to `laradock:master`.
|
||||
* If we suggest changes then:
|
||||
* Make the required updates.
|
||||
* Commit your changes to your branch (e.g. `my-fix-branch`).
|
||||
* Push the changes to your GitHub repository (this will update your Pull Request).
|
||||
|
||||
> If the PR gets too outdated we may ask you to rebase and force push to update the PR:
|
||||
|
||||
```shell
|
||||
git rebase master -i
|
||||
git push origin my-fix-branch -f
|
||||
```
|
||||
|
||||
*WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.*
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### After your pull request is merged
|
||||
|
||||
After your pull request is merged, you can safely delete your branch and pull the changes
|
||||
from the main (upstream) repository:
|
||||
|
||||
* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
|
||||
|
||||
```shell
|
||||
git push origin --delete my-fix-branch
|
||||
```
|
||||
|
||||
* Check out the master branch:
|
||||
|
||||
```shell
|
||||
git checkout master -f
|
||||
```
|
||||
|
||||
* Delete the local branch:
|
||||
|
||||
```shell
|
||||
git branch -D my-fix-branch
|
||||
```
|
||||
|
||||
* Update your master with the latest upstream version:
|
||||
|
||||
```shell
|
||||
git pull --ff upstream master
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
### Happy Coding :)
|
290
README.md
290
README.md
@ -19,7 +19,7 @@ It's like Laravel Homestead but for Docker instead of Vagrant.
|
||||
|
||||
- [Intro](#Intro)
|
||||
- [Features](#features)
|
||||
- [Supported Containers](#Supported-Containers)
|
||||
- [Supported Software's](#Supported-Containers)
|
||||
- [What is Docker](#what-is-docker)
|
||||
- [What is Laravel](#what-is-laravel)
|
||||
- [Why Docker not Vagrant](#why-docker-not-vagrant)
|
||||
@ -50,13 +50,12 @@ It's like Laravel Homestead but for Docker instead of Vagrant.
|
||||
- [Change the PHP-CLI Version](#Change-the-PHP-CLI-Version)
|
||||
- [Install xDebug](#Install-xDebug)
|
||||
- [Misc](#Misc)
|
||||
- [Run a Docker Virtual Host](#Run-Docker-Virtual-Host)
|
||||
- [Find your Docker IP Address](#Find-Docker-IP-Address)
|
||||
- [Use custom Domain](#Use-custom-Domain)
|
||||
- [Enable Global Composer Build Install](#Enable-Global-Composer-Build-Install)
|
||||
- [Install Prestissimo](#Install-Prestissimo)
|
||||
- [Install Node + NVM](#Install-Node)
|
||||
- [Debugging](#debugging)
|
||||
- [Upgrading LaraDock](#upgrading-laradock)
|
||||
- [Help & Questions](#Help)
|
||||
|
||||
|
||||
@ -68,11 +67,20 @@ LaraDock strives to make the development experience easier.
|
||||
It contains pre-packaged Docker Images that provides you a wonderful development environment without requiring you to install PHP, NGINX, MySQL, REDIS, and any other software on your local machine.
|
||||
|
||||
|
||||
**Usage Overview:** Run `NGINX`, `MySQL` and `Redis`.
|
||||
**Usage Overview:**
|
||||
|
||||
Let's see how easy it is to install `NGINX`, `PHP`, `Composer`, `MySQL` and `Redis`. Then run `Laravel`.
|
||||
|
||||
1. Get LaraDock inside your Laravel project:
|
||||
<br>
|
||||
`git clone https://github.com/LaraDock/laradock.git`.
|
||||
2. Enter the laradock folder and run only these Containers:
|
||||
<br>
|
||||
`docker-compose up -d nginx mysql redis`
|
||||
3. Open your `.env` file and set `DB_HOST` to `mysql` and `REDIS_HOST` to `redis`.
|
||||
4. Open your browser and visit the localhost: `http://localdock`
|
||||
|
||||
|
||||
```shell
|
||||
docker-compose up nginx mysql redis
|
||||
```
|
||||
|
||||
<a name="features"></a>
|
||||
### Features
|
||||
@ -93,25 +101,31 @@ docker-compose up nginx mysql redis
|
||||
|
||||
|
||||
<a name="Supported-Containers"></a>
|
||||
### Supported Containers
|
||||
### Supported Software's (Containers)
|
||||
|
||||
- PHP-FPM
|
||||
- NGINX
|
||||
- HHVM
|
||||
- MySQL
|
||||
- PostgreSQL
|
||||
- MariaDB
|
||||
- MongoDB
|
||||
- Neo4j
|
||||
- Redis
|
||||
- Memcached
|
||||
- Caddy
|
||||
- Beanstalkd
|
||||
- Beanstalkd Console
|
||||
- Workspace (contains: Composer, PHP7-CLI, Laravel Installer, Git, Node, Gulp, SQLite, Vim, Nano, cURL...)
|
||||
- **Database Engines:**
|
||||
- MySQL
|
||||
- PostgreSQL
|
||||
- MariaDB
|
||||
- MongoDB
|
||||
- Neo4j
|
||||
- **Cache Engines:**
|
||||
- Redis
|
||||
- Memcached
|
||||
- **PHP Servers:**
|
||||
- NGINX
|
||||
- Apache2
|
||||
- Caddy
|
||||
- **PHP Compilers:**
|
||||
- PHP-FPM
|
||||
- HHVM
|
||||
- **Message Queueing Systems:**
|
||||
- Beanstalkd (+ Beanstalkd Console)
|
||||
- **Tools:**
|
||||
- Workspace (PHP7-CLI, Composer, Git, Node, Gulp, SQLite, Vim, Nano, cURL...)
|
||||
|
||||
|
||||
>If you can't find your container, build it yourself and add it to this list. Contributions are welcomed :)
|
||||
>If you can't find your Software, build it yourself and add it to this list. Contributions are welcomed :)
|
||||
|
||||
|
||||
|
||||
@ -153,20 +167,27 @@ Running a virtual Container is much faster than running a full virtual Machine.
|
||||
|
||||
|
||||
|
||||
<a name="Requirements"></a>
|
||||
## Requirements
|
||||
|
||||
| Linux | Windows & MAC |
|
||||
|--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|
|
||||
| [Laravel](https://laravel.com/docs/master/installation) | [Laravel](https://laravel.com/docs/master/installation) |
|
||||
| [Git](https://git-scm.com/downloads) | [Git](https://git-scm.com/downloads) |
|
||||
| [Docker Engine](https://docs.docker.com/engine/installation/linux/ubuntulinux) | [Docker Toolbox](https://www.docker.com/toolbox) OR [Native Docker](https://beta.docker.com/) |
|
||||
| [Docker Compose](https://docs.docker.com/compose/install) | |
|
||||
|
||||
<a name="Demo"></a>
|
||||
## Demo Video
|
||||
|
||||
What's better than a [**Demo Video**](https://www.youtube.com/watch?v=-DamFMczwDA) :)
|
||||
What's better than a **Demo Video**:
|
||||
|
||||
- LaraDock v4.0 (Coming soon..)
|
||||
- LaraDock [v2.2](https://www.youtube.com/watch?v=-DamFMczwDA)
|
||||
- LaraDock [v0.3](https://www.youtube.com/watch?v=jGkyO6Is_aI)
|
||||
- LaraDock [v0.1](https://www.youtube.com/watch?v=3YQsHe6oF80)
|
||||
|
||||
|
||||
|
||||
<a name="Requirements"></a>
|
||||
## Requirements
|
||||
|
||||
- [Git](https://git-scm.com/downloads)
|
||||
- [Docker](https://www.docker.com/products/docker/)
|
||||
|
||||
|
||||
|
||||
<a name="Installation"></a>
|
||||
## Installation
|
||||
@ -174,7 +195,7 @@ What's better than a [**Demo Video**](https://www.youtube.com/watch?v=-DamFMczwD
|
||||
|
||||
1 - Clone the `LaraDock` repository:
|
||||
|
||||
**A)** If you already have a Laravel project, clone this repository on your `Laravel` root direcotry:
|
||||
**A)** If you already have a Laravel project, clone this repository on your `Laravel` root directory:
|
||||
|
||||
```bash
|
||||
git submodule add https://github.com/LaraDock/laradock.git
|
||||
@ -193,13 +214,21 @@ git clone https://github.com/LaraDock/laradock.git
|
||||
## Usage
|
||||
|
||||
|
||||
1 - For **Windows & MAC** users only: If you are not using the native Docker-Engine `Beta`, make sure you have a running Docker Virtual Host on your machine.
|
||||
[How to run a Docker Virtual Host?](#Run-Docker-Virtual-Host)
|
||||
(**Linux** users don't need a Virtual Host, so skip this step).
|
||||
**Read Before starting:**
|
||||
|
||||
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](#upgrading-laradock)
|
||||
- Use LaraDock v3.* (Visit the `LaraDock-ToolBox` [Branch](https://github.com/LaraDock/laradock/tree/LaraDock-ToolBox)).
|
||||
|
||||
|
||||
If you are using **Docker Native** (For Mac/Windows) or even for Linux, continue this documentation normally since LaraDock v4 and above is just for that.
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
2 - Run some Containers: *(Make sure you are in the `laradock` folder before running the `docker-compose` commands).*
|
||||
<br>
|
||||
1 - Run Containers: *(Make sure you are in the `laradock` folder before running the `docker-compose` commands).*
|
||||
|
||||
|
||||
|
||||
@ -209,46 +238,43 @@ git clone https://github.com/LaraDock/laradock.git
|
||||
docker-compose up -d nginx mysql
|
||||
```
|
||||
|
||||
You can select your own combination of container form this list:
|
||||
You can select your own combination of Containers form the list below:
|
||||
|
||||
`nginx`, `hhvm` ,`mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `memcached`, `beanstalkd`, `beanstalkd-console`, `caddy`, `workspace`, `php-fpm`.
|
||||
`nginx`, `hhvm`, `php-fpm`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `apache2`, `caddy`, `memcached`, `beanstalkd`, `beanstalkd-console`, `workspace`.
|
||||
|
||||
|
||||
**Note**: `workspace` and `php-fpm` will run automatically in most of the cases, so no need to specify them in the `up` command.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, ...).
|
||||
2 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, ...).
|
||||
|
||||
```bash
|
||||
docker exec -it {Workspace-Container-Name} bash
|
||||
docker-compose exec workspace bash
|
||||
```
|
||||
Replace `{Workspace-Container-Name}` with your Workspace container name.
|
||||
<br>
|
||||
To find the containers names type `docker-compose ps`.
|
||||
<br />
|
||||
Add `--user=laradock` (example `docker-compose exec --user=laradock workspace bash`) to have files created as your host's user. (you can change the PUID (User id) and PGID (group id) variables from the `docker-compose.yml`).
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
4 - Edit the Laravel configurations.
|
||||
3 - Edit the Laravel configurations.
|
||||
|
||||
If you don't have a Laravel project installed yet, see [How to Install Laravel in a Docker Container](#Install-Laravel).
|
||||
|
||||
Open your Laravel's `.env` file and set the `DB_HOST` to your `{Docker-IP}`:
|
||||
Open your Laravel's `.env` file and set the `DB_HOST` to your `mysql`:
|
||||
|
||||
```env
|
||||
DB_HOST=xxx.xxx.xxx.xxx
|
||||
DB_HOST=mysql
|
||||
```
|
||||
[How to find my Docker IP Address?](#Find-Docker-IP-Address)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
5 - Open your browser and visit your `{Docker-IP}` address (`http://xxx.xxx.xxx.xxx`).
|
||||
4 - Open your browser and visit your localhost address (`http://localhost/`).
|
||||
|
||||
|
||||
|
||||
@ -262,8 +288,6 @@ If you need a special support. Contact me, more details in the [Help & Questions
|
||||
<a name="Documentation"></a>
|
||||
## Documentation
|
||||
|
||||
**Note:** this documentation doesn't cover the Docker Beta *(Native Docker on MAC and Windows)*. However, the commands are very similar. We are planning to cover the Docker Beta soon.
|
||||
|
||||
|
||||
<a name="Docker"></a>
|
||||
### [Docker]
|
||||
@ -327,8 +351,15 @@ docker-compose down
|
||||
2 - enter any container using:
|
||||
|
||||
```bash
|
||||
docker exec -it {container-name} bash
|
||||
docker-compose exec {container-name} bash
|
||||
```
|
||||
|
||||
*Example: enter MySQL container*
|
||||
|
||||
```bash
|
||||
docker-compose exec mysql bash
|
||||
```
|
||||
|
||||
3 - to exit a container, type `exit`.
|
||||
|
||||
|
||||
@ -380,10 +411,7 @@ example for `mysql` it will be `mysql/Dockerfile`.
|
||||
```bash
|
||||
docker-compose build mysql
|
||||
```
|
||||
|
||||
*If you find any bug or you have and suggestion that can improve the performance of any image, please consider contributing. Thanks in advance.*
|
||||
|
||||
|
||||
More info on Containers rebuilding [here](#Build-Re-build-Containers).
|
||||
|
||||
|
||||
|
||||
@ -407,6 +435,7 @@ Optionally you can specify which container to rebuild (instead of rebuilding all
|
||||
docker-compose build {container-name}
|
||||
```
|
||||
|
||||
You might use the `--no-cache` option if you want full rebuilding (`docker-compose build --no-cache {container-name}`).
|
||||
|
||||
|
||||
|
||||
@ -484,6 +513,8 @@ Since the new Laravel application is in the `my-cool-app` folder, we need to rep
|
||||
cd my-cool-app
|
||||
```
|
||||
|
||||
5 - Go back to the laraDock installation steps to see how to edit the `.env` file.
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
@ -507,9 +538,12 @@ docker-compose ps
|
||||
3 - Enter the Workspace container:
|
||||
|
||||
```bash
|
||||
docker exec -it {workspace-container-name} bash
|
||||
docker-compose exec workspace bash
|
||||
```
|
||||
|
||||
Add `--user=laradock` (example `docker-compose exec --user=laradock workspace bash`) to have files created as your host's user.
|
||||
|
||||
|
||||
4 - Run anything you want :)
|
||||
|
||||
```bash
|
||||
@ -532,19 +566,19 @@ phpunit
|
||||
docker-compose up -d redis
|
||||
```
|
||||
|
||||
2 - Open your Laravel's `.env` file and set the `REDIS_HOST` to your `Docker-IP` instead of the default `127.0.0.1` IP.
|
||||
2 - Open your Laravel's `.env` file and set the `REDIS_HOST` to `redis`
|
||||
|
||||
```env
|
||||
REDIS_HOST=xxx.xxx.xxx.xxx
|
||||
REDIS_HOST=redis
|
||||
```
|
||||
|
||||
If you don't find the `REDIS_HOST` variable in your `.env` file. Go to the database config file `config/database.php` and replace the default `127.0.0.1` IP with your `Docker-IP` for Redis like this:
|
||||
If you don't find the `REDIS_HOST` variable in your `.env` file. Go to the database config file `config/database.php` and replace the default `127.0.0.1` IP with `redis` for Redis like this:
|
||||
|
||||
```php
|
||||
'redis' => [
|
||||
'cluster' => false,
|
||||
'default' => [
|
||||
'host' => 'xxx.xxx.xxx.xxx',
|
||||
'host' => 'redis',
|
||||
'port' => 6379,
|
||||
'database' => 0,
|
||||
],
|
||||
@ -578,15 +612,15 @@ composer require predis/predis:^1.0
|
||||
<a name="Use-Mongo"></a>
|
||||
### Use Mongo
|
||||
|
||||
1 - First install `mongo` in the Workspace and the PHP-FPM Containers:
|
||||
1 - First install `mongo` in the Workspace and the PHP-FPM Containers:
|
||||
<br>
|
||||
a) open the `docker-compose.yml` file
|
||||
<br>
|
||||
b) search for the `INSTALL_MONGO` argument under the Workspace Container
|
||||
b) search for the `INSTALL_MONGO` argument under the Workspace Container
|
||||
<br>
|
||||
c) set it to `true`
|
||||
<br>
|
||||
d) search for the `INSTALL_MONGO` argument under the PHP-FPM Container
|
||||
d) search for the `INSTALL_MONGO` argument under the PHP-FPM Container
|
||||
<br>
|
||||
e) set it to `true`
|
||||
|
||||
@ -642,7 +676,7 @@ docker-compose up -d mongo
|
||||
|
||||
5 - Open your Laravel's `.env` file and update the following variables:
|
||||
|
||||
- set the `DB_HOST` to your `Docker-IP`.
|
||||
- set the `DB_HOST` to your `mongo`.
|
||||
- set the `DB_PORT` to `27017`.
|
||||
- set the `DB_DATABASE` to `database`.
|
||||
|
||||
@ -657,7 +691,7 @@ More details about this [here](https://github.com/jenssegers/laravel-mongodb#ins
|
||||
7 - Test it:
|
||||
|
||||
- First let your Models extend from the Mongo Eloquent Model. Check the [documentation](https://github.com/jenssegers/laravel-mongodb#eloquent).
|
||||
- Enter the Workspace Container `docker exec -it laradock_workspace_1 bash`.
|
||||
- Enter the Workspace Container.
|
||||
- Migrate the Database `php artisan migrate`.
|
||||
|
||||
|
||||
@ -767,15 +801,15 @@ Right now you have to manually edit the `Dockerfile` or create a new one like it
|
||||
<a name="Install-xDebug"></a>
|
||||
### Install xDebug
|
||||
|
||||
1 - First install `xDebug` in the Workspace and the PHP-FPM Containers:
|
||||
1 - First install `xDebug` in the Workspace and the PHP-FPM Containers:
|
||||
<br>
|
||||
a) open the `docker-compose.yml` file
|
||||
<br>
|
||||
b) search for the `INSTALL_XDEBUG` argument under the Workspace Container
|
||||
b) search for the `INSTALL_XDEBUG` argument under the Workspace Container
|
||||
<br>
|
||||
c) set it to `true`
|
||||
<br>
|
||||
d) search for the `INSTALL_XDEBUG` argument under the PHP-FPM Container
|
||||
d) search for the `INSTALL_XDEBUG` argument under the PHP-FPM Container
|
||||
<br>
|
||||
e) set it to `true`
|
||||
|
||||
@ -805,92 +839,19 @@ It should be like this:
|
||||
### [Misc]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="Run-Docker-Virtual-Host"></a>
|
||||
### Run a Docker Virtual Host
|
||||
|
||||
These steps are only for **Windows & MAC** users *(Linux users don't need a virtual host)*:
|
||||
|
||||
1 - Run the default Host:
|
||||
|
||||
```bash
|
||||
docker-machine start default
|
||||
```
|
||||
|
||||
* If the host "default" does not exist, create one using the command below, else skip it:
|
||||
|
||||
* ```bash
|
||||
docker-machine create -d virtualbox default
|
||||
```
|
||||
|
||||
2 - Run this command to configure your shell:
|
||||
|
||||
```bash
|
||||
eval $(docker-machine env)
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Find-Docker-IP-Address"></a>
|
||||
### Find your Docker IP Address
|
||||
|
||||
**On Windows & MAC:**
|
||||
|
||||
Run this command in your terminal:
|
||||
|
||||
```bash
|
||||
docker-machine ip default
|
||||
```
|
||||
If your Host name is different then `default`, you have to specify it (`docker-machine ip my-host`).
|
||||
|
||||
*(The default IP is 192.168.99.100)*
|
||||
|
||||
<br>
|
||||
|
||||
> **boot2docker** users: run `boot2docker ip` *(when boot2docker is up)*.
|
||||
|
||||
<br>
|
||||
**On Linux:**
|
||||
|
||||
Run this command in your terminal:
|
||||
|
||||
```shell
|
||||
ifconfig docker0 | grep 'inet' | cut -d: -f2 | awk '{ print $1}' | head -n1
|
||||
```
|
||||
|
||||
*(The default IP is 172.17.0.1)*
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Use-custom-Domain"></a>
|
||||
### Use custom Domain (instead of the Docker IP)
|
||||
|
||||
Assuming your custom domain is `laravel.dev` and your current `Docker-IP` is `xxx.xxx.xxx.xxx`.
|
||||
Assuming your custom domain is `laravel.dev`
|
||||
|
||||
1 - Open your `/etc/hosts` file and map your `Docker IP` to the `laravel.dev` domain, by adding the following:
|
||||
1 - Open your `/etc/hosts` file and map your localhost address `127.0.0.1` to the `laravel.dev` domain, by adding the following:
|
||||
|
||||
```bash
|
||||
xxx.xxx.xxx.xxx laravel.dev
|
||||
127.0.0.1 laravel.dev
|
||||
```
|
||||
|
||||
2 - Open your Laravel's `.env` file and replace the `127.0.0.1` default values with your `{Docker-IP}`.
|
||||
<br>
|
||||
Example:
|
||||
|
||||
```env
|
||||
DB_HOST=xxx.xxx.xxx.xxx
|
||||
```
|
||||
|
||||
3 - Open your browser and visit `{http://laravel.dev}`
|
||||
|
||||
2 - Open your browser and visit `{http://laravel.dev}`
|
||||
|
||||
|
||||
Optionally you can define the server name in the nginx config file, like this:
|
||||
@ -932,7 +893,7 @@ It should be like this:
|
||||
<a name="Install-Prestissimo"></a>
|
||||
### Install Prestissimo
|
||||
|
||||
[Prestissimo](https://github.com/hirak/prestissimo) is a plugin for composer which enables parallel install functionality.
|
||||
[Prestissimo](https://github.com/hirak/prestissimo) is a plugin for composer which enables parallel install functionality.
|
||||
|
||||
1 - Enable Running Global Composer Install during the Build:
|
||||
|
||||
@ -972,6 +933,8 @@ It should be like this:
|
||||
|
||||
3 - Re-build the container `docker-compose build workspace`
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="debugging"></a>
|
||||
### Debugging
|
||||
@ -988,23 +951,48 @@ sudo chmod -R 777 storage bootstrap/cache
|
||||
|
||||
#### I see "Welcome to nginx" instead of the Laravel App!
|
||||
|
||||
Use `http://127.0.0.1` (or [your Docker IP](#Find-Docker-IP-Address)) instead of `http://localhost` in your browser.
|
||||
Use `http://127.0.0.1` instead of `http://localhost` in your browser.
|
||||
|
||||
#### I see an error message containing `address already in use`
|
||||
|
||||
Make sure the ports for the services that you are trying to run (80, 3306, etc.) are not being used already by other programs, such as a built in `apache`/`httpd` service or other development tools you have installed.
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="upgrading-laradock"></a>
|
||||
### Upgrading LaraDock
|
||||
|
||||
|
||||
Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading LaraDock from v3.* to v4.*:
|
||||
|
||||
1. Stop the docker vm `docker-machine stop {default}`
|
||||
2. Install Docker for [Mac](https://docs.docker.com/docker-for-mac/) or [Windows](https://docs.docker.com/docker-for-windows/).
|
||||
3. Upgrade LaraDock to `v4.*.*` (`git pull origin master`)
|
||||
4. Use LaraDock as you used to do: `docker-compose up -d nginx mysql`.
|
||||
|
||||
**Note:** If you face any problem with the last step above: rebuild all your containers
|
||||
`docker-compose build --no-cache`
|
||||
"Warnning Containers Data might be lost!"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
## Contributing
|
||||
|
||||
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)
|
||||
|
||||
<a name="Help"></a>
|
||||
## Help & Questions
|
||||
|
||||
Join the chat room on [Gitter](https://gitter.im/LaraDock/laradock) and get help and support from the community.
|
||||
Join the chat room on [Gitter](https://gitter.im/LaraDock/laradock) and get help and support from the community.
|
||||
|
||||
You can as well can open an [issue](https://github.com/laradock/laradock/issues) on Github (will be labeled as Question) and discuss it with people on [Gitter](https://gitter.im/LaraDock/laradock).
|
||||
|
||||
|
17
apache2/Dockerfile
Normal file
17
apache2/Dockerfile
Normal file
@ -0,0 +1,17 @@
|
||||
FROM webdevops/apache:ubuntu-16.04
|
||||
|
||||
MAINTAINER Eric Pfeiffer <computerfr33k@users.noreply.github.com>
|
||||
|
||||
ARG PHP_SOCKET="php-fpm:9000"
|
||||
|
||||
ENV WEB_PHP_SOCKET=$PHP_SOCKET
|
||||
|
||||
ENV WEB_DOCUMENT_ROOT=/var/www/laravel/public
|
||||
|
||||
EXPOSE 80 443
|
||||
|
||||
WORKDIR /var/www/laravel/public
|
||||
|
||||
ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"]
|
||||
|
||||
CMD ["supervisord"]
|
@ -7,9 +7,9 @@ RUN apt-get update && apt-get install -y curl
|
||||
RUN curl -sL https://github.com/ptrofimov/beanstalk_console/archive/master.tar.gz | tar xvz -C /tmp
|
||||
RUN mv /tmp/beanstalk_console-master /source
|
||||
|
||||
RUN apt-get remove --purge -y curl &&
|
||||
apt-get autoclean &&
|
||||
apt-get clean &&
|
||||
RUN apt-get remove --purge -y curl && \
|
||||
apt-get autoclean && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
EXPOSE 2080
|
||||
|
@ -12,6 +12,8 @@ services:
|
||||
- INSTALL_XDEBUG=false
|
||||
- INSTALL_NODE=false
|
||||
- COMPOSER_GLOBAL_INSTALL=false
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
volumes_from:
|
||||
- volumes_source
|
||||
tty: true
|
||||
@ -49,6 +51,23 @@ services:
|
||||
links:
|
||||
- php-fpm
|
||||
|
||||
### Apache Server Container ##################################
|
||||
|
||||
apache2:
|
||||
build:
|
||||
context: ./apache2
|
||||
args:
|
||||
- PHP_SOCKET="php-fpm:9000"
|
||||
volumes_from:
|
||||
- volumes_source
|
||||
volumes:
|
||||
- ./logs/apache2:/var/log/apache2
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
links:
|
||||
- php-fpm
|
||||
|
||||
### HHVM Container ##########################################
|
||||
|
||||
hhvm:
|
||||
@ -188,12 +207,12 @@ services:
|
||||
volumes_data:
|
||||
build: ./volumes/data
|
||||
volumes:
|
||||
- /var/lib/mysql:/var/lib/mysql
|
||||
- /var/lib/postgres:/var/lib/postgres
|
||||
- /var/lib/mariadb:/var/lib/mariadb
|
||||
- /var/lib/memcached:/var/lib/memcached
|
||||
- /var/lib/redis:/data
|
||||
- /var/lib/neo4j:/var/lib/neo4j/data
|
||||
- /var/lib/mongo:/data/db
|
||||
- ./data/mysql:/var/lib/mysql
|
||||
- ./data/postgres:/var/lib/postgres
|
||||
- ./data/mariadb:/var/lib/mariadb
|
||||
- ./data/memcached:/var/lib/memcached
|
||||
- ./data/redis:/data
|
||||
- ./data/neo4j:/var/lib/neo4j/data
|
||||
- ./data/mongo:/data/db
|
||||
|
||||
### Add more Containers below ###############################
|
||||
|
@ -3,8 +3,14 @@
|
||||
# Image Setup
|
||||
#--------------------------------------------------------------------------
|
||||
#
|
||||
# To edit the 'php-fpm' base Image, visit its repository on Github
|
||||
# https://github.com/LaraDock/php-fpm
|
||||
#
|
||||
# To change its version, see the available Tags on the Docker Hub:
|
||||
# https://hub.docker.com/r/laradock/php-fpm/tags/
|
||||
#
|
||||
|
||||
FROM laradock/php-fpm:5.6--1.0
|
||||
FROM laradock/php-fpm:5.6--1.1
|
||||
|
||||
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
||||
|
||||
|
@ -3,8 +3,14 @@
|
||||
# Image Setup
|
||||
#--------------------------------------------------------------------------
|
||||
#
|
||||
# To edit the 'php-fpm' base Image, visit its repository on Github
|
||||
# https://github.com/LaraDock/php-fpm
|
||||
#
|
||||
# To change its version, see the available Tags on the Docker Hub:
|
||||
# https://hub.docker.com/r/laradock/php-fpm/tags/
|
||||
#
|
||||
|
||||
FROM laradock/php-fpm:7.0--1.0
|
||||
FROM laradock/php-fpm:7.0--1.1
|
||||
|
||||
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
||||
|
||||
|
@ -3,8 +3,14 @@
|
||||
# Image Setup
|
||||
#--------------------------------------------------------------------------
|
||||
#
|
||||
# To edit the 'workspace' base Image, visit its repository on Github
|
||||
# https://github.com/LaraDock/workspace
|
||||
#
|
||||
# To change its version, see the available Tags on the Docker Hub:
|
||||
# https://hub.docker.com/r/laradock/workspace/tags/
|
||||
#
|
||||
|
||||
FROM laradock/workspace:1.0
|
||||
FROM laradock/workspace:1.1
|
||||
|
||||
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
||||
|
||||
@ -60,14 +66,28 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \
|
||||
echo "extension=mongodb.so" >> /etc/php/7.0/cli/php.ini \
|
||||
;fi
|
||||
|
||||
#####################################
|
||||
# Non-Root User:
|
||||
#####################################
|
||||
|
||||
# Add a non-root user to prevent files being created with root permissions on host machine.
|
||||
ARG PUID=1000
|
||||
ARG PGID=1000
|
||||
RUN groupadd -g $PGID laradock && \
|
||||
useradd -u $PUID -g laradock -m laradock
|
||||
|
||||
#####################################
|
||||
# Composer:
|
||||
#####################################
|
||||
|
||||
# Add the composer.json
|
||||
ADD ./composer.json /root/.composer/composer.json
|
||||
COPY ./composer.json /home/laradock/.composer/composer.json
|
||||
|
||||
# Check if global install need to be runned
|
||||
# Make sure that ~/.composer belongs to laradock
|
||||
RUN chown -R laradock:laradock /home/laradock/.composer
|
||||
USER laradock
|
||||
|
||||
# Check if global install need to be ran
|
||||
ARG COMPOSER_GLOBAL_INSTALL=true
|
||||
ENV COMPOSER_GLOBAL_INSTALL ${COMPOSER_GLOBAL_INSTALL}
|
||||
RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \
|
||||
@ -84,13 +104,13 @@ ARG INSTALL_NODE=true
|
||||
ENV INSTALL_NODE ${INSTALL_NODE}
|
||||
RUN if [ ${INSTALL_NODE} = true ]; then \
|
||||
# Install nvm (A Node Version Manager)
|
||||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash \
|
||||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | bash \
|
||||
;fi
|
||||
# Again check if NVM needs to be installed
|
||||
# I had to split this condifiton link this because when I get it inside the above if statment is refuses to work!
|
||||
# I had to split this condition link this because when I get it inside the above if statement is refuses to work!
|
||||
ENV if [ ${INSTALL_NODE} = true ]; then \
|
||||
# Set the ENV
|
||||
NVM_DIR=/root/.nvm \
|
||||
NVM_DIR=/home/laradock/.nvm \
|
||||
# Install NodeJS with NVM
|
||||
RUN . ~/.nvm/nvm.sh && \
|
||||
nvm install stable && \
|
||||
@ -99,6 +119,14 @@ ENV if [ ${INSTALL_NODE} = true ]; then \
|
||||
npm install -g gulp bower \
|
||||
;fi
|
||||
|
||||
# Wouldn't execute when added to the RUN statement in the above block
|
||||
# Source NVM when loading bash since ~/.profile isn't loaded on non-login shell
|
||||
RUN if [ ${INSTALL_NODE} = true ]; then \
|
||||
echo "" >> ~/.bashrc && \
|
||||
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc && \
|
||||
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
|
||||
;fi
|
||||
|
||||
#
|
||||
#--------------------------------------------------------------------------
|
||||
# Final Touch
|
||||
@ -106,6 +134,7 @@ ENV if [ ${INSTALL_NODE} = true ]; then \
|
||||
#
|
||||
|
||||
# Clean up
|
||||
USER root
|
||||
RUN apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
|
Reference in New Issue
Block a user