Compare commits
51 Commits
Author | SHA1 | Date | |
---|---|---|---|
d6329c26b3 | |||
a96ee88692 | |||
2799a94a9f | |||
5bcbe0d291 | |||
9e7a669d5b | |||
9b084433c3 | |||
fc303dee08 | |||
d75a43c615 | |||
06337e6024 | |||
16b82d066e | |||
074deec781 | |||
2d382b683a | |||
68576f9022 | |||
2df00ecdad | |||
aeb5a6bb63 | |||
2bbf59ddda | |||
dca0545293 | |||
5f99478c76 | |||
48a53f1d24 | |||
11cdfd440b | |||
14cbe9f935 | |||
42d63236f1 | |||
d01d087431 | |||
11c65c4a00 | |||
1b9630e8a1 | |||
3a714339da | |||
65078505c1 | |||
e0b4734dab | |||
243392444f | |||
72a8fc049d | |||
de6db93da8 | |||
1af9dc5ac2 | |||
62878e7c49 | |||
3cd1f070e1 | |||
fb5ea7f42c | |||
aa8be6f95b | |||
aa0a726945 | |||
e5e04e4e18 | |||
44d8720400 | |||
f0200626ba | |||
69406db3e0 | |||
bcb749151a | |||
ca413edff4 | |||
f6d1d6f617 | |||
117382a050 | |||
2e930df2a7 | |||
4922c5fafd | |||
198c38f6cd | |||
8d216f83d5 | |||
05c5fcf216 | |||
fccee522c6 |
4
.gitignore
vendored
4
.gitignore
vendored
@ -1 +1,3 @@
|
|||||||
/logs
|
/logs
|
||||||
|
/data
|
||||||
|
.env
|
123
README.md
123
README.md
@ -7,6 +7,7 @@ LaraDock helps you run your **Laravel** App on **Docker** real quick.
|
|||||||
<br>
|
<br>
|
||||||
It's like Laravel Homestead but for Docker instead of Vagrant.
|
It's like Laravel Homestead but for Docker instead of Vagrant.
|
||||||
|
|
||||||
|
>With LaraDock, use Docker first and learn about it later.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@ -49,6 +50,7 @@ It's like Laravel Homestead but for Docker instead of Vagrant.
|
|||||||
- [Run a Docker Virtual Host](#Run-Docker-Virtual-Host)
|
- [Run a Docker Virtual Host](#Run-Docker-Virtual-Host)
|
||||||
- [Find your Docker IP Address](#Find-Docker-IP-Address)
|
- [Find your Docker IP Address](#Find-Docker-IP-Address)
|
||||||
- [Use custom Domain](#Use-custom-Domain)
|
- [Use custom Domain](#Use-custom-Domain)
|
||||||
|
- [Install Prestissimo](#Install-Prestissimo)
|
||||||
- [Debugging](#debugging)
|
- [Debugging](#debugging)
|
||||||
- [Help & Questions](#Help)
|
- [Help & Questions](#Help)
|
||||||
|
|
||||||
@ -98,7 +100,8 @@ docker-compose up nginx mysql redis
|
|||||||
- Memcached
|
- Memcached
|
||||||
- Beanstalkd
|
- Beanstalkd
|
||||||
- Beanstalkd Console
|
- Beanstalkd Console
|
||||||
- Workspace (contains: Composer, PHP7-CLI, Laravel Installer, Git, Node, Gulp, Bower, SQLite, Vim, Nano and cURL)
|
- Caddy
|
||||||
|
- Workspace (contains: Composer, PHP7-CLI, Laravel Installer, Git, Node, Gulp, Bower, SQLite, Vim, Nano, cURL and much more)
|
||||||
- Data *(Databases Data Container)*
|
- Data *(Databases Data Container)*
|
||||||
- Application *(Application Code Container)*
|
- Application *(Application Code Container)*
|
||||||
|
|
||||||
@ -112,7 +115,7 @@ docker-compose up nginx mysql redis
|
|||||||
<a name="what-is-docker"></a>
|
<a name="what-is-docker"></a>
|
||||||
### What is Docker?
|
### What is Docker?
|
||||||
|
|
||||||
[Docker](https://www.docker.com) is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of [operating-system-level virtualization](https://en.wikipedia.org/wiki/Operating-system-level_virtualization) on Linux, Mac OS and Windows.
|
[Docker](https://www.docker.com) is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of [operating-system-level virtualization](https://en.wikipedia.org/wiki/Operating-system-level_virtualization) on Linux, Mac OS and Windows.
|
||||||
|
|
||||||
<a name="what-is-laravel"></a>
|
<a name="what-is-laravel"></a>
|
||||||
### What is Laravel?
|
### What is Laravel?
|
||||||
@ -127,7 +130,7 @@ Seriously!!!
|
|||||||
|
|
||||||
Instead of providing a full Virtual Machines, like you get with Vagrant, Docker provides you **lightweight** Virtual Containers, that share the same kernel and allow to safely execute independent processes.
|
Instead of providing a full Virtual Machines, like you get with Vagrant, Docker provides you **lightweight** Virtual Containers, that share the same kernel and allow to safely execute independent processes.
|
||||||
|
|
||||||
In addition to the speed, Docker gives tens of features that cannot be achieved with Vagrant.
|
In addition to the speed, Docker gives tons of features that cannot be achieved with Vagrant.
|
||||||
|
|
||||||
Most importantly Docker can run on Development and on Production (same environment everywhere). While Vagrant is designed for Development only, (so you have to re-provision your server on Production every time).
|
Most importantly Docker can run on Development and on Production (same environment everywhere). While Vagrant is designed for Development only, (so you have to re-provision your server on Production every time).
|
||||||
|
|
||||||
@ -139,31 +142,26 @@ LaraDock and [Homestead](https://laravel.com/docs/master/homestead) both gives y
|
|||||||
|
|
||||||
- Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine.
|
- Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine.
|
||||||
|
|
||||||
- LaraDock is a tool that controls Docker for you (using Docker Compose official commands). And Docker manages you Virtual Containers.
|
- LaraDock is a tool that controls Docker for you (using Docker & Docker Compose official commands). And Docker manages your Virtual Containers.
|
||||||
|
|
||||||
Running a virtual Container is much faster than running a full virtual Machine.
|
Running a virtual Container is much faster than running a full virtual Machine. Thus **LaraDock is much faster than Homestead**.
|
||||||
<br>Thus **LaraDock is much faster than Homestead**.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="Requirements"></a>
|
<a name="Requirements"></a>
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
| Linux | Windows & MAC |
|
| Linux | Windows & MAC |
|
||||||
|-----------------------------------------------------------------------------------------|---------------------------------------------------------|
|
|--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|
|
||||||
| [Laravel](https://laravel.com/docs/master/installation) | [Laravel](https://laravel.com/docs/master/installation) |
|
| [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) |
|
| [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) |
|
| [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) | |
|
| [Docker Compose](https://docs.docker.com/compose/install) | |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="Demo"></a>
|
<a name="Demo"></a>
|
||||||
## Demo Video
|
## Demo Video
|
||||||
|
|
||||||
What's better than a [**Demo Video**](https://www.youtube.com/watch?v=-DamFMczwDA) :)
|
What's better than a [**Demo Video**](https://www.youtube.com/watch?v=-DamFMczwDA) :)
|
||||||
|
|
||||||
<a name="Installation"></a>
|
<a name="Installation"></a>
|
||||||
## Installation
|
## Installation
|
||||||
@ -190,16 +188,15 @@ git clone https://github.com/LaraDock/laradock.git
|
|||||||
## Usage
|
## 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.
|
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).
|
(**Linux** users don't need a Virtual Host, so skip this step).
|
||||||
|
|
||||||
[How to run a Docker Virtual Host?](#Run-Docker-Virtual-Host)
|
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
2 - Run the Containers, (you can select the containers that you wish to run)
|
2 - Run some Containers: *(Make sure you are in the `laradock` folder before running the `docker-compose` commands).*
|
||||||
<br>
|
|
||||||
*Make sure you are in the `laradock` folder before running the `docker-compose` command.*
|
|
||||||
|
|
||||||
**Example:** Running NGINX and MySQL:
|
**Example:** Running NGINX and MySQL:
|
||||||
|
|
||||||
@ -207,10 +204,14 @@ git clone https://github.com/LaraDock/laradock.git
|
|||||||
docker-compose up -d nginx mysql
|
docker-compose up -d nginx mysql
|
||||||
```
|
```
|
||||||
|
|
||||||
*Note: the PHP-FPM, Workspace, Application and Data Containers will automatically run.*
|
You can select your own combination of container form this list:
|
||||||
|
|
||||||
|
`nginx`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `memcached`, `beanstalkd`, `beanstalkd-console`, `caddy`, `workspace`, `data`, `php-fpm`, `application`.
|
||||||
|
|
||||||
|
|
||||||
|
**Note**: `workspace`, `data`, `php-fpm` and `application` will run automatically in most of the cases.
|
||||||
|
|
||||||
|
|
||||||
Supported Containers: `nginx`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `memcached`, `beanstalkd`, `beanstalkd-console`, `workspace`, `data`, `php-fpm`, `application`.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -220,7 +221,7 @@ Supported Containers: `nginx`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`,
|
|||||||
```bash
|
```bash
|
||||||
docker exec -it {Workspace-Container-Name} bash
|
docker exec -it {Workspace-Container-Name} bash
|
||||||
```
|
```
|
||||||
Replace `{Workspace-Container-Name}` with your Workspace container name.
|
Replace `{Workspace-Container-Name}` with your Workspace container name.
|
||||||
<br>
|
<br>
|
||||||
To find the containers names type `docker-compose ps`.
|
To find the containers names type `docker-compose ps`.
|
||||||
|
|
||||||
@ -256,6 +257,7 @@ If you need a special support. Contact me, more details in the [Help & Questions
|
|||||||
<a name="Documentation"></a>
|
<a name="Documentation"></a>
|
||||||
## Documentation
|
## 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>
|
<a name="Docker"></a>
|
||||||
@ -303,7 +305,7 @@ docker-compose stop {container-name}
|
|||||||
docker-compose down
|
docker-compose down
|
||||||
```
|
```
|
||||||
|
|
||||||
*Note: Careful with this command as it will delete your Data Volume Container as well. (if you want to keep your Database data than you should stop each container by itself as follow):*
|
*Note: Careful with this command as it will delete your Data Volume Container as well. (if you want to keep your Database data than you should stop each container by itself as follow):*
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -335,7 +337,7 @@ docker exec -it {container-name} bash
|
|||||||
### Edit default container configuration
|
### Edit default container configuration
|
||||||
Open the `docker-compose.yml` and change anything you want.
|
Open the `docker-compose.yml` and change anything you want.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
Change MySQL Database Name:
|
Change MySQL Database Name:
|
||||||
|
|
||||||
@ -362,7 +364,7 @@ Change Redis defaut port to 1111:
|
|||||||
<a name="Edit-a-Docker-Image"></a>
|
<a name="Edit-a-Docker-Image"></a>
|
||||||
### Edit a Docker Image
|
### Edit a Docker Image
|
||||||
|
|
||||||
1 - Find the `dockerfile` of the image you want to edit,
|
1 - Find the `dockerfile` of the image you want to edit,
|
||||||
<br>
|
<br>
|
||||||
example for `mysql` it will be `mysql/Dockerfile`.
|
example for `mysql` it will be `mysql/Dockerfile`.
|
||||||
|
|
||||||
@ -421,7 +423,7 @@ To add an image (software), just edit the `docker-compose.yml` and add your cont
|
|||||||
|
|
||||||
<br>
|
<br>
|
||||||
<a name="View-the-Log-files"></a>
|
<a name="View-the-Log-files"></a>
|
||||||
### View the Log files
|
### View the Log files
|
||||||
The Nginx Log file is stored in the `logs/nginx` directory.
|
The Nginx Log file is stored in the `logs/nginx` directory.
|
||||||
|
|
||||||
However to view the logs of all the other containers (MySQL, PHP-FPM,...) you can run this:
|
However to view the logs of all the other containers (MySQL, PHP-FPM,...) you can run this:
|
||||||
@ -461,7 +463,7 @@ For more about the Laravel installation click [here](https://laravel.com/docs/ma
|
|||||||
|
|
||||||
3 - Edit `docker-compose.yml` to Map the new application path:
|
3 - Edit `docker-compose.yml` to Map the new application path:
|
||||||
|
|
||||||
By default LaraDock assumes the Laravel application is living in the parent directory of the laradock folder.
|
By default LaraDock assumes the Laravel application is living in the parent directory of the laradock folder.
|
||||||
|
|
||||||
Since the new Laravel application is in the `my-cool-app` folder, we need to replace `../:/var/www/laravel` with `../my-cool-app/:/var/www/laravel`, as follow:
|
Since the new Laravel application is in the `my-cool-app` folder, we need to replace `../:/var/www/laravel` with `../my-cool-app/:/var/www/laravel`, as follow:
|
||||||
|
|
||||||
@ -515,13 +517,6 @@ Composer update
|
|||||||
phpunit
|
phpunit
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<a name="Use-Redis"></a>
|
<a name="Use-Redis"></a>
|
||||||
### Use Redis
|
### Use Redis
|
||||||
@ -624,7 +619,7 @@ More details about this [here](https://github.com/jenssegers/laravel-mongodb#ins
|
|||||||
5 - Test it:
|
5 - Test it:
|
||||||
|
|
||||||
- First let your Models extend from the Mongo Eloquent Model. Check the [documentation](https://github.com/jenssegers/laravel-mongodb#eloquent).
|
- First let your Models extend from the Mongo Eloquent Model. Check the [documentation](https://github.com/jenssegers/laravel-mongodb#eloquent).
|
||||||
- Enter the Workspace Continer `docker exec -it laradock_workspace_1 bash`.
|
- Enter the Workspace Container `docker exec -it laradock_workspace_1 bash`.
|
||||||
- Migrate the Database `php artisan migrate`.
|
- Migrate the Database `php artisan migrate`.
|
||||||
|
|
||||||
|
|
||||||
@ -669,11 +664,11 @@ By default **PHP-FPM 7.0** is running.
|
|||||||
|
|
||||||
2 - Search for `Dockerfile-70` in the PHP container section.
|
2 - Search for `Dockerfile-70` in the PHP container section.
|
||||||
|
|
||||||
3 - Change the version number.
|
3 - Change the version number.
|
||||||
<br>
|
<br>
|
||||||
Example to select version 5.6 instead of 7.0 you have to replace `Dockerfile-70` with `Dockerfile-56`.
|
Example to select version 5.6 instead of 7.0 you have to replace `Dockerfile-70` with `Dockerfile-56`.
|
||||||
|
|
||||||
Sample:
|
Sample:
|
||||||
|
|
||||||
```txt
|
```txt
|
||||||
php-fpm:
|
php-fpm:
|
||||||
@ -765,9 +760,9 @@ eval $(docker-machine env)
|
|||||||
|
|
||||||
<br>
|
<br>
|
||||||
<a name="Find-Docker-IP-Address"></a>
|
<a name="Find-Docker-IP-Address"></a>
|
||||||
### Find your Docker IP Address
|
### Find your Docker IP Address
|
||||||
|
|
||||||
**On Windows & MAC:**
|
**On Windows & MAC:**
|
||||||
|
|
||||||
Run this command in your terminal:
|
Run this command in your terminal:
|
||||||
|
|
||||||
@ -783,7 +778,7 @@ If your Host name is different then `default`, you have to specify it (`docker-m
|
|||||||
> **boot2docker** users: run `boot2docker ip` *(when boot2docker is up)*.
|
> **boot2docker** users: run `boot2docker ip` *(when boot2docker is up)*.
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
**On Linux:**
|
**On Linux:**
|
||||||
|
|
||||||
Run this command in your terminal:
|
Run this command in your terminal:
|
||||||
|
|
||||||
@ -826,30 +821,33 @@ server_name laravel.dev;
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<a name="Install-Prestissimo"></a>
|
||||||
|
### Install Prestissimo
|
||||||
|
|
||||||
|
[Prestissimo](https://github.com/hirak/prestissimo) is a plugin for composer which enables parallel install functionality. You can enable Prestissimo by setting `INSTALL_PRESTISSIMO=true` in the `docker-compose.yml` file.
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<a name="debugging"></a>
|
<a name="debugging"></a>
|
||||||
### Debugging
|
### Debugging
|
||||||
|
|
||||||
*Here's a list of the common problems you might face, and the possible solutions.*
|
*Here's a list of the common problems you might face, and the possible solutions.*
|
||||||
|
|
||||||
#### + I see a blank (white) page instead of the Laravel 'Welcome' page!
|
#### I see a blank (white) page instead of the Laravel 'Welcome' page!
|
||||||
|
|
||||||
run this command from the Laravel root directory:
|
Run the following command from the Laravel root directory:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo chmod -R 777 storage bootstrap/cache
|
sudo chmod -R 777 storage bootstrap/cache
|
||||||
```
|
```
|
||||||
|
|
||||||
#### + I see "Welcome to nginx" instead of the Laravel App!
|
#### I see "Welcome to nginx" instead of the Laravel App!
|
||||||
|
|
||||||
use `http://127.0.0.1` instead of `http://localhost` in your browser.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Use `http://127.0.0.1` (or [your Docker IP](#Find-Docker-IP-Address)) 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>
|
<br>
|
||||||
@ -870,8 +868,23 @@ Additionally, you can contact Mahmoud Zalt (the creator of this project) via a d
|
|||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
- [Mahmoud Zalt](https://github.com/Mahmoudz) (Twitter [@Mahmoud_Zalt](https://twitter.com/Mahmoud_Zalt))
|
**Creator:**
|
||||||
- [Awesome list of contributors](https://github.com/LaraDock/laradock/graphs/contributors)
|
|
||||||
|
- [Mahmoud Zalt](https://github.com/Mahmoudz) (Twitter [@Mahmoud_Zalt](https://twitter.com/Mahmoud_Zalt))
|
||||||
|
|
||||||
|
**Main Contributors:**
|
||||||
|
|
||||||
|
- [Jack Fletcher](https://github.com/Kauhat)
|
||||||
|
- [Bo-Yi Wu](https://github.com/appleboy)
|
||||||
|
- [Amin Mkh](https://github.com/AminMkh)
|
||||||
|
- [Matthew Tonkin Dunn](https://github.com/mattythebatty)
|
||||||
|
- [Benmag](https://github.com/benmag)
|
||||||
|
|
||||||
|
**Awesome People:**
|
||||||
|
|
||||||
|
- [Contributors](https://github.com/LaraDock/laradock/graphs/contributors)
|
||||||
|
- [Supporters](https://github.com/LaraDock/laradock/issues?utf8=%E2%9C%93&q=)
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
12
caddy/Caddyfile
Normal file
12
caddy/Caddyfile
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Docs: https://caddyserver.com/docs/caddyfile
|
||||||
|
0.0.0.0:80
|
||||||
|
fastcgi / php-fpm:9000 php
|
||||||
|
rewrite {
|
||||||
|
to /index.php?{query}
|
||||||
|
}
|
||||||
|
browse
|
||||||
|
log stdout
|
||||||
|
errors stdout
|
||||||
|
# Uncomment to enable TLS (HTTPS)
|
||||||
|
# Change the first list to listen on port 443 when enabling TLS
|
||||||
|
#tls self_signed
|
22
caddy/Dockerfile
Normal file
22
caddy/Dockerfile
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
FROM alpine:3.4
|
||||||
|
MAINTAINER Eric Pfeiffer <computerfr33k@users.noreply.github.com>
|
||||||
|
|
||||||
|
LABEL caddy_version="0.9.0" architecture="amd64"
|
||||||
|
|
||||||
|
RUN apk update \
|
||||||
|
&& apk upgrade \
|
||||||
|
&& apk add tar curl
|
||||||
|
|
||||||
|
RUN curl --silent --show-error --fail --location \
|
||||||
|
--header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \
|
||||||
|
"https://github.com/mholt/caddy/releases/download/v0.9.0/caddy_linux_amd64.tar.gz" \
|
||||||
|
| tar --no-same-owner -C /usr/bin/ -xz caddy_linux_amd64 \
|
||||||
|
&& mv /usr/bin/caddy_linux_amd64 /usr/bin/caddy \
|
||||||
|
&& chmod 0755 /usr/bin/caddy \
|
||||||
|
&& /usr/bin/caddy -version
|
||||||
|
|
||||||
|
EXPOSE 80 443 2015
|
||||||
|
WORKDIR /var/www/laravel/public
|
||||||
|
|
||||||
|
ENTRYPOINT ["caddy"]
|
||||||
|
CMD ["-conf", "/etc/Caddyfile"]
|
@ -2,45 +2,12 @@ version: '2'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
### PHP-FPM Container #######################################
|
|
||||||
|
|
||||||
php-fpm:
|
|
||||||
build:
|
|
||||||
context: ./php-fpm
|
|
||||||
dockerfile: Dockerfile-70
|
|
||||||
volumes_from:
|
|
||||||
- application
|
|
||||||
expose:
|
|
||||||
- "9000"
|
|
||||||
links:
|
|
||||||
- workspace
|
|
||||||
|
|
||||||
### Laravel Application Code Container ######################
|
|
||||||
|
|
||||||
application:
|
|
||||||
build: ./application
|
|
||||||
volumes:
|
|
||||||
- ../:/var/www/laravel
|
|
||||||
|
|
||||||
### Databases Data Container ################################
|
|
||||||
|
|
||||||
data:
|
|
||||||
build: ./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
|
|
||||||
|
|
||||||
### Nginx Server Container ##################################
|
### Nginx Server Container ##################################
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
build: ./nginx
|
build: ./nginx
|
||||||
volumes_from:
|
volumes_from:
|
||||||
- application
|
- volumes_source
|
||||||
volumes:
|
volumes:
|
||||||
- ./logs/nginx/:/var/log/nginx
|
- ./logs/nginx/:/var/log/nginx
|
||||||
ports:
|
ports:
|
||||||
@ -49,12 +16,25 @@ services:
|
|||||||
links:
|
links:
|
||||||
- php-fpm
|
- php-fpm
|
||||||
|
|
||||||
|
### PHP-FPM Container #######################################
|
||||||
|
|
||||||
|
php-fpm:
|
||||||
|
build:
|
||||||
|
context: ./php-fpm
|
||||||
|
dockerfile: Dockerfile-70
|
||||||
|
volumes_from:
|
||||||
|
- volumes_source
|
||||||
|
expose:
|
||||||
|
- "9000"
|
||||||
|
links:
|
||||||
|
- workspace
|
||||||
|
|
||||||
### MySQL Container #########################################
|
### MySQL Container #########################################
|
||||||
|
|
||||||
mysql:
|
mysql:
|
||||||
build: ./mysql
|
build: ./mysql
|
||||||
volumes_from:
|
volumes_from:
|
||||||
- data
|
- volumes_data
|
||||||
ports:
|
ports:
|
||||||
- "3306:3306"
|
- "3306:3306"
|
||||||
environment:
|
environment:
|
||||||
@ -68,7 +48,7 @@ services:
|
|||||||
postgres:
|
postgres:
|
||||||
build: ./postgres
|
build: ./postgres
|
||||||
volumes_from:
|
volumes_from:
|
||||||
- data
|
- volumes_data
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432"
|
- "5432:5432"
|
||||||
environment:
|
environment:
|
||||||
@ -81,7 +61,7 @@ services:
|
|||||||
mariadb:
|
mariadb:
|
||||||
build: ./mariadb
|
build: ./mariadb
|
||||||
volumes_from:
|
volumes_from:
|
||||||
- data
|
- volumes_data
|
||||||
ports:
|
ports:
|
||||||
- "3306:3306"
|
- "3306:3306"
|
||||||
environment:
|
environment:
|
||||||
@ -100,7 +80,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- NEO4J_AUTH=homestead:secret
|
- NEO4J_AUTH=homestead:secret
|
||||||
volumes_from:
|
volumes_from:
|
||||||
- data
|
- volumes_data
|
||||||
|
|
||||||
### MongoDB Container #######################################
|
### MongoDB Container #######################################
|
||||||
|
|
||||||
@ -109,14 +89,14 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "27017:27017"
|
- "27017:27017"
|
||||||
volumes_from:
|
volumes_from:
|
||||||
- data
|
- volumes_data
|
||||||
|
|
||||||
### Redis Container #########################################
|
### Redis Container #########################################
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
build: ./redis
|
build: ./redis
|
||||||
volumes_from:
|
volumes_from:
|
||||||
- data
|
- volumes_data
|
||||||
ports:
|
ports:
|
||||||
- "6379:6379"
|
- "6379:6379"
|
||||||
|
|
||||||
@ -125,7 +105,7 @@ services:
|
|||||||
memcached:
|
memcached:
|
||||||
build: ./memcached
|
build: ./memcached
|
||||||
volumes_from:
|
volumes_from:
|
||||||
- data
|
- volumes_data
|
||||||
ports:
|
ports:
|
||||||
- "11211:11211"
|
- "11211:11211"
|
||||||
links:
|
links:
|
||||||
@ -153,9 +133,48 @@ services:
|
|||||||
### Workspace Utilities Container ###########################
|
### Workspace Utilities Container ###########################
|
||||||
|
|
||||||
workspace:
|
workspace:
|
||||||
build: ./workspace
|
build:
|
||||||
|
context: ./workspace
|
||||||
|
args:
|
||||||
|
- INSTALL_PRESTISSIMO=false
|
||||||
volumes_from:
|
volumes_from:
|
||||||
- application
|
- volumes_source
|
||||||
tty: true
|
tty: true
|
||||||
|
|
||||||
|
### Laravel Application Code Container ######################
|
||||||
|
|
||||||
|
volumes_source:
|
||||||
|
build: ./volumes/application
|
||||||
|
volumes:
|
||||||
|
- ../:/var/www/laravel
|
||||||
|
|
||||||
|
### Databases Data Container ################################
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
### Caddy Server Container ##################################
|
||||||
|
# Edit the Caddyfile if needed (./caddy/Caddyfile)
|
||||||
|
|
||||||
|
caddy:
|
||||||
|
build: ./caddy
|
||||||
|
volumes_from:
|
||||||
|
- volumes_source
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
- "443:443"
|
||||||
|
- "2015:2015"
|
||||||
|
volumes:
|
||||||
|
- ./caddy/Caddyfile:/etc/Caddyfile
|
||||||
|
links:
|
||||||
|
- php-fpm
|
||||||
|
|
||||||
### Add more Containers below ###############################
|
### Add more Containers below ###############################
|
||||||
|
@ -15,6 +15,7 @@ http {
|
|||||||
tcp_nodelay on;
|
tcp_nodelay on;
|
||||||
keepalive_timeout 15;
|
keepalive_timeout 15;
|
||||||
types_hash_max_size 2048;
|
types_hash_max_size 2048;
|
||||||
|
client_max_body_size 20M;
|
||||||
include /etc/nginx/mime.types;
|
include /etc/nginx/mime.types;
|
||||||
default_type application/octet-stream;
|
default_type application/octet-stream;
|
||||||
access_log on;
|
access_log on;
|
||||||
|
@ -9,13 +9,31 @@ RUN apt-get update && apt-get install -y \
|
|||||||
libpq-dev \
|
libpq-dev \
|
||||||
libmemcached-dev \
|
libmemcached-dev \
|
||||||
curl \
|
curl \
|
||||||
|
libjpeg-dev \
|
||||||
|
libpng12-dev \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libssl-dev \
|
||||||
|
libmcrypt-dev \
|
||||||
--no-install-recommends \
|
--no-install-recommends \
|
||||||
&& rm -r /var/lib/apt/lists/*
|
&& rm -r /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# install mcrypt library
|
||||||
|
RUN docker-php-ext-install mcrypt
|
||||||
|
|
||||||
|
# Install mongodb driver
|
||||||
|
RUN pecl install mongodb
|
||||||
|
|
||||||
|
# configure gd library
|
||||||
|
RUN docker-php-ext-configure gd \
|
||||||
|
--enable-gd-native-ttf \
|
||||||
|
--with-jpeg-dir=/usr/lib \
|
||||||
|
--with-freetype-dir=/usr/include/freetype2
|
||||||
|
|
||||||
# Install extensions using the helper script provided by the base image
|
# Install extensions using the helper script provided by the base image
|
||||||
RUN docker-php-ext-install \
|
RUN docker-php-ext-install \
|
||||||
pdo_mysql \
|
pdo_mysql \
|
||||||
pdo_pgsql
|
pdo_pgsql \
|
||||||
|
gd
|
||||||
|
|
||||||
# Install memcached
|
# Install memcached
|
||||||
RUN pecl install memcached \
|
RUN pecl install memcached \
|
||||||
@ -25,9 +43,6 @@ RUN pecl install memcached \
|
|||||||
RUN pecl install xdebug \
|
RUN pecl install xdebug \
|
||||||
&& docker-php-ext-enable xdebug
|
&& docker-php-ext-enable xdebug
|
||||||
|
|
||||||
# Install mongodb driver
|
|
||||||
RUN pecl install mongodb
|
|
||||||
|
|
||||||
RUN usermod -u 1000 www-data
|
RUN usermod -u 1000 www-data
|
||||||
|
|
||||||
WORKDIR /var/www/laravel
|
WORKDIR /var/www/laravel
|
||||||
|
@ -9,13 +9,31 @@ RUN apt-get update && apt-get install -y \
|
|||||||
libpq-dev \
|
libpq-dev \
|
||||||
libmemcached-dev \
|
libmemcached-dev \
|
||||||
curl \
|
curl \
|
||||||
|
libjpeg-dev \
|
||||||
|
libpng12-dev \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libssl-dev \
|
||||||
|
libmcrypt-dev \
|
||||||
--no-install-recommends \
|
--no-install-recommends \
|
||||||
&& rm -r /var/lib/apt/lists/*
|
&& rm -r /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# install mcrypt library
|
||||||
|
RUN docker-php-ext-install mcrypt
|
||||||
|
|
||||||
|
# Install mongodb driver
|
||||||
|
RUN pecl install mongodb
|
||||||
|
|
||||||
|
# configure gd library
|
||||||
|
RUN docker-php-ext-configure gd \
|
||||||
|
--enable-gd-native-ttf \
|
||||||
|
--with-jpeg-dir=/usr/lib \
|
||||||
|
--with-freetype-dir=/usr/include/freetype2
|
||||||
|
|
||||||
# Install extensions using the helper script provided by the base image
|
# Install extensions using the helper script provided by the base image
|
||||||
RUN docker-php-ext-install \
|
RUN docker-php-ext-install \
|
||||||
pdo_mysql \
|
pdo_mysql \
|
||||||
pdo_pgsql
|
pdo_pgsql \
|
||||||
|
gd
|
||||||
|
|
||||||
# Install memcached
|
# Install memcached
|
||||||
RUN pecl install memcached \
|
RUN pecl install memcached \
|
||||||
@ -25,9 +43,6 @@ RUN pecl install memcached \
|
|||||||
RUN pecl install xdebug \
|
RUN pecl install xdebug \
|
||||||
&& docker-php-ext-enable xdebug
|
&& docker-php-ext-enable xdebug
|
||||||
|
|
||||||
# Install mongodb driver
|
|
||||||
RUN pecl install mongodb
|
|
||||||
|
|
||||||
RUN usermod -u 1000 www-data
|
RUN usermod -u 1000 www-data
|
||||||
|
|
||||||
WORKDIR /var/www/laravel
|
WORKDIR /var/www/laravel
|
||||||
|
@ -9,29 +9,51 @@ RUN apt-get update && apt-get install -y \
|
|||||||
libpq-dev \
|
libpq-dev \
|
||||||
libmemcached-dev \
|
libmemcached-dev \
|
||||||
curl \
|
curl \
|
||||||
|
libjpeg-dev \
|
||||||
|
libpng12-dev \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libssl-dev \
|
||||||
|
libmcrypt-dev \
|
||||||
--no-install-recommends \
|
--no-install-recommends \
|
||||||
&& rm -r /var/lib/apt/lists/*
|
&& rm -r /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# install mcrypt library
|
||||||
|
RUN docker-php-ext-install mcrypt
|
||||||
|
|
||||||
|
# Install mongodb driver
|
||||||
|
RUN pecl install mongodb
|
||||||
|
|
||||||
|
# configure gd library
|
||||||
|
RUN docker-php-ext-configure gd \
|
||||||
|
--enable-gd-native-ttf \
|
||||||
|
--with-jpeg-dir=/usr/lib \
|
||||||
|
--with-freetype-dir=/usr/include/freetype2
|
||||||
|
|
||||||
# Install extensions using the helper script provided by the base image
|
# Install extensions using the helper script provided by the base image
|
||||||
RUN docker-php-ext-install \
|
RUN docker-php-ext-install \
|
||||||
pdo_mysql \
|
pdo_mysql \
|
||||||
pdo_pgsql
|
pdo_pgsql \
|
||||||
|
gd
|
||||||
|
|
||||||
# Install Memcached for php 7
|
# Install Memcached for php 7
|
||||||
RUN curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/php7.tar.gz" \
|
RUN curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/php7.tar.gz" \
|
||||||
&& mkdir -p /usr/src/php/ext/memcached \
|
&& mkdir -p memcached \
|
||||||
&& tar -C /usr/src/php/ext/memcached -zxvf /tmp/memcached.tar.gz --strip 1 \
|
&& tar -C memcached -zxvf /tmp/memcached.tar.gz --strip 1 \
|
||||||
&& docker-php-ext-configure memcached \
|
&& ( \
|
||||||
&& docker-php-ext-install memcached \
|
cd memcached \
|
||||||
&& rm /tmp/memcached.tar.gz
|
&& phpize \
|
||||||
|
&& ./configure \
|
||||||
|
&& make -j$(nproc) \
|
||||||
|
&& make install \
|
||||||
|
) \
|
||||||
|
&& rm -r memcached \
|
||||||
|
&& rm /tmp/memcached.tar.gz \
|
||||||
|
&& docker-php-ext-enable memcached
|
||||||
|
|
||||||
# Install xdebug
|
# Install xdebug
|
||||||
RUN pecl install xdebug \
|
RUN pecl install xdebug \
|
||||||
&& docker-php-ext-enable xdebug
|
&& docker-php-ext-enable xdebug
|
||||||
|
|
||||||
# Install mongodb driver
|
|
||||||
RUN pecl install mongodb
|
|
||||||
|
|
||||||
RUN usermod -u 1000 www-data
|
RUN usermod -u 1000 www-data
|
||||||
|
|
||||||
WORKDIR /var/www/laravel
|
WORKDIR /var/www/laravel
|
||||||
|
@ -2,3 +2,13 @@ date.timezone=UTC
|
|||||||
display_errors=Off
|
display_errors=Off
|
||||||
log_errors=On
|
log_errors=On
|
||||||
extension=mongodb.so
|
extension=mongodb.so
|
||||||
|
|
||||||
|
; Maximum amount of memory a script may consume (128MB)
|
||||||
|
; http://php.net/memory-limit
|
||||||
|
memory_limit = 128M
|
||||||
|
; Maximum allowed size for uploaded files.
|
||||||
|
; http://php.net/upload-max-filesize
|
||||||
|
upload_max_filesize = 20M
|
||||||
|
; Sets max size of post data allowed.
|
||||||
|
; http://php.net/post-max-size
|
||||||
|
post_max_size = 20M
|
||||||
|
@ -34,6 +34,8 @@ RUN apt-get update && apt-get install -y --force-yes \
|
|||||||
php7.0-sqlite3 \
|
php7.0-sqlite3 \
|
||||||
php7.0-zip \
|
php7.0-zip \
|
||||||
php7.0-memcached \
|
php7.0-memcached \
|
||||||
|
php7.0-gd \
|
||||||
|
php7.0-xdebug \
|
||||||
php-dev \
|
php-dev \
|
||||||
libcurl4-openssl-dev \
|
libcurl4-openssl-dev \
|
||||||
libedit-dev \
|
libedit-dev \
|
||||||
@ -46,36 +48,40 @@ RUN apt-get update && apt-get install -y --force-yes \
|
|||||||
curl \
|
curl \
|
||||||
vim \
|
vim \
|
||||||
nano \
|
nano \
|
||||||
nodejs \
|
pkg-config
|
||||||
nodejs-dev \
|
|
||||||
npm
|
|
||||||
|
|
||||||
# Clean up, to free some space
|
# Clean up, to free some space
|
||||||
RUN apt-get clean
|
RUN apt-get clean
|
||||||
|
|
||||||
# Install gulp and bower with NPM
|
# remove load xdebug extension (only load on phpunit command)
|
||||||
RUN npm install -g \
|
RUN sed -i 's/^/;/g' /etc/php/7.0/cli/conf.d/20-xdebug.ini
|
||||||
gulp \
|
|
||||||
bower
|
|
||||||
|
|
||||||
# Link the global gulp to be used locally
|
# Add bin folder of composer to PATH.
|
||||||
RUN npm link gulp
|
RUN echo "export PATH=${PATH}:/var/www/laravel/vendor/bin" >> ~/.bashrc
|
||||||
|
|
||||||
# Add a symbolic link for Node
|
|
||||||
RUN ln -s /usr/bin/nodejs /usr/bin/node
|
|
||||||
|
|
||||||
# Add an alias for PHPUnit
|
|
||||||
RUN echo "alias phpunit='./vendor/bin/phpunit'" >> ~/.bashrc
|
|
||||||
|
|
||||||
# Install Composer
|
# Install Composer
|
||||||
RUN curl -s http://getcomposer.org/installer | php \
|
RUN curl -s http://getcomposer.org/installer | php \
|
||||||
&& mv composer.phar /usr/local/bin/ \
|
&& mv composer.phar /usr/local/bin/composer
|
||||||
&& echo "alias composer='/usr/local/bin/composer.phar'" >> ~/.bashrc
|
|
||||||
|
# Load xdebug Zend extension with phpunit command
|
||||||
|
RUN echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/laravel/vendor/bin/phpunit'" >> ~/.bashrc
|
||||||
|
|
||||||
# Install mongodb extension
|
# Install mongodb extension
|
||||||
RUN pecl install mongodb
|
RUN pecl install mongodb
|
||||||
RUN echo "extension=mongodb.so" >> /etc/php/7.0/cli/php.ini
|
RUN echo "extension=mongodb.so" >> /etc/php/7.0/cli/php.ini
|
||||||
|
|
||||||
|
# Install nvm (Node Version Manager)
|
||||||
|
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash
|
||||||
|
|
||||||
|
ENV NVM_DIR=/root/.nvm
|
||||||
|
|
||||||
|
# Install stable node
|
||||||
|
RUN . ~/.nvm/nvm.sh \
|
||||||
|
&& nvm install stable \
|
||||||
|
&& nvm use stable \
|
||||||
|
&& nvm alias stable \
|
||||||
|
&& npm install -g gulp bower
|
||||||
|
|
||||||
# Source the bash
|
# Source the bash
|
||||||
RUN . ~/.bashrc
|
RUN . ~/.bashrc
|
||||||
|
|
||||||
@ -83,3 +89,9 @@ RUN . ~/.bashrc
|
|||||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
WORKDIR /var/www/laravel
|
WORKDIR /var/www/laravel
|
||||||
|
|
||||||
|
# Install optional software
|
||||||
|
ARG INSTALL_PRESTISSIMO=false
|
||||||
|
RUN if [ "$INSTALL_PRESTISSIMO" = true ] ; then \
|
||||||
|
composer global require "hirak/prestissimo:^0.3"; \
|
||||||
|
fi
|
||||||
|
Reference in New Issue
Block a user