Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
fc303dee08 | |||
d75a43c615 | |||
06337e6024 | |||
16b82d066e | |||
074deec781 | |||
2d382b683a | |||
68576f9022 | |||
2df00ecdad | |||
aeb5a6bb63 | |||
2bbf59ddda | |||
dca0545293 | |||
5f99478c76 | |||
48a53f1d24 | |||
11cdfd440b | |||
14cbe9f935 | |||
42d63236f1 | |||
d01d087431 | |||
11c65c4a00 | |||
1b9630e8a1 | |||
3a714339da | |||
65078505c1 | |||
e0b4734dab |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
/logs
|
||||
/data
|
||||
.env
|
52
README.md
52
README.md
@ -7,6 +7,7 @@ LaraDock helps you run your **Laravel** App on **Docker** real quick.
|
||||
<br>
|
||||
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)
|
||||
- [Find your Docker IP Address](#Find-Docker-IP-Address)
|
||||
- [Use custom Domain](#Use-custom-Domain)
|
||||
- [Install Prestissimo](#Install-Prestissimo)
|
||||
- [Debugging](#debugging)
|
||||
- [Help & Questions](#Help)
|
||||
|
||||
@ -98,7 +100,7 @@ docker-compose up nginx mysql redis
|
||||
- Memcached
|
||||
- Beanstalkd
|
||||
- Beanstalkd Console
|
||||
- Workspace (contains: Composer, PHP7-CLI, Laravel Installer, Git, Node, Gulp, Bower, SQLite, Vim, Nano and cURL)
|
||||
- Workspace (contains: Composer, PHP7-CLI, Laravel Installer, Git, Node, Gulp, Bower, SQLite, Vim, Nano, cURL and much more)
|
||||
- Data *(Databases Data Container)*
|
||||
- Application *(Application Code Container)*
|
||||
|
||||
@ -112,7 +114,7 @@ docker-compose up nginx mysql redis
|
||||
<a name="what-is-docker"></a>
|
||||
### 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>
|
||||
### What is Laravel?
|
||||
@ -127,7 +129,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.
|
||||
|
||||
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).
|
||||
|
||||
@ -139,26 +141,21 @@ 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.
|
||||
|
||||
- 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.
|
||||
<br>Thus **LaraDock is much faster than Homestead**.
|
||||
Running a virtual Container is much faster than running a full virtual Machine. Thus **LaraDock is much faster than Homestead**.
|
||||
|
||||
|
||||
|
||||
<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) |
|
||||
| [Docker Compose](https://docs.docker.com/compose/install) | |
|
||||
|
||||
|
||||
|
||||
|
||||
| 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
|
||||
@ -259,6 +256,7 @@ 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>
|
||||
@ -822,30 +820,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>
|
||||
<a name="debugging"></a>
|
||||
### Debugging
|
||||
|
||||
*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
|
||||
sudo chmod -R 777 storage bootstrap/cache
|
||||
```
|
||||
|
||||
#### + I see "Welcome to nginx" instead of the Laravel App!
|
||||
|
||||
use `http://127.0.0.1` instead of `http://localhost` in your browser.
|
||||
|
||||
|
||||
|
||||
|
||||
#### 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.
|
||||
|
||||
#### 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>
|
||||
@ -872,6 +873,7 @@ Additionally, you can contact Mahmoud Zalt (the creator of this project) via a d
|
||||
|
||||
**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)
|
||||
|
@ -2,45 +2,12 @@ version: '2'
|
||||
|
||||
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:
|
||||
build: ./nginx
|
||||
volumes_from:
|
||||
- application
|
||||
- volumes_source
|
||||
volumes:
|
||||
- ./logs/nginx/:/var/log/nginx
|
||||
ports:
|
||||
@ -49,12 +16,25 @@ services:
|
||||
links:
|
||||
- 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:
|
||||
build: ./mysql
|
||||
volumes_from:
|
||||
- data
|
||||
- volumes_data
|
||||
ports:
|
||||
- "3306:3306"
|
||||
environment:
|
||||
@ -68,7 +48,7 @@ services:
|
||||
postgres:
|
||||
build: ./postgres
|
||||
volumes_from:
|
||||
- data
|
||||
- volumes_data
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
@ -81,7 +61,7 @@ services:
|
||||
mariadb:
|
||||
build: ./mariadb
|
||||
volumes_from:
|
||||
- data
|
||||
- volumes_data
|
||||
ports:
|
||||
- "3306:3306"
|
||||
environment:
|
||||
@ -100,7 +80,7 @@ services:
|
||||
environment:
|
||||
- NEO4J_AUTH=homestead:secret
|
||||
volumes_from:
|
||||
- data
|
||||
- volumes_data
|
||||
|
||||
### MongoDB Container #######################################
|
||||
|
||||
@ -109,14 +89,14 @@ services:
|
||||
ports:
|
||||
- "27017:27017"
|
||||
volumes_from:
|
||||
- data
|
||||
- volumes_data
|
||||
|
||||
### Redis Container #########################################
|
||||
|
||||
redis:
|
||||
build: ./redis
|
||||
volumes_from:
|
||||
- data
|
||||
- volumes_data
|
||||
ports:
|
||||
- "6379:6379"
|
||||
|
||||
@ -125,7 +105,7 @@ services:
|
||||
memcached:
|
||||
build: ./memcached
|
||||
volumes_from:
|
||||
- data
|
||||
- volumes_data
|
||||
ports:
|
||||
- "11211:11211"
|
||||
links:
|
||||
@ -156,9 +136,29 @@ services:
|
||||
build:
|
||||
context: ./workspace
|
||||
args:
|
||||
INSTALL_PRESTISSIMO: ${INSTALL_PRESTISSIMO}
|
||||
- INSTALL_PRESTISSIMO=false
|
||||
volumes_from:
|
||||
- application
|
||||
- volumes_source
|
||||
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
|
||||
|
||||
### Add more Containers below ###############################
|
||||
|
@ -15,6 +15,7 @@ http {
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 15;
|
||||
types_hash_max_size 2048;
|
||||
client_max_body_size 20M;
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
access_log on;
|
||||
|
@ -9,6 +9,7 @@ RUN apt-get update && apt-get install -y \
|
||||
libpq-dev \
|
||||
libmemcached-dev \
|
||||
curl \
|
||||
libjpeg-dev \
|
||||
libpng12-dev \
|
||||
libfreetype6-dev \
|
||||
libssl-dev \
|
||||
@ -25,6 +26,7 @@ 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
|
||||
|
@ -9,6 +9,7 @@ RUN apt-get update && apt-get install -y \
|
||||
libpq-dev \
|
||||
libmemcached-dev \
|
||||
curl \
|
||||
libjpeg-dev \
|
||||
libpng12-dev \
|
||||
libfreetype6-dev \
|
||||
libssl-dev \
|
||||
@ -25,6 +26,7 @@ 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
|
||||
|
@ -9,6 +9,7 @@ RUN apt-get update && apt-get install -y \
|
||||
libpq-dev \
|
||||
libmemcached-dev \
|
||||
curl \
|
||||
libjpeg-dev \
|
||||
libpng12-dev \
|
||||
libfreetype6-dev \
|
||||
libssl-dev \
|
||||
@ -25,6 +26,7 @@ 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
|
||||
@ -35,11 +37,18 @@ RUN docker-php-ext-install \
|
||||
|
||||
# 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" \
|
||||
&& mkdir -p /usr/src/php/ext/memcached \
|
||||
&& tar -C /usr/src/php/ext/memcached -zxvf /tmp/memcached.tar.gz --strip 1 \
|
||||
&& docker-php-ext-configure memcached \
|
||||
&& docker-php-ext-install memcached \
|
||||
&& rm /tmp/memcached.tar.gz
|
||||
&& mkdir -p memcached \
|
||||
&& tar -C memcached -zxvf /tmp/memcached.tar.gz --strip 1 \
|
||||
&& ( \
|
||||
cd memcached \
|
||||
&& phpize \
|
||||
&& ./configure \
|
||||
&& make -j$(nproc) \
|
||||
&& make install \
|
||||
) \
|
||||
&& rm -r memcached \
|
||||
&& rm /tmp/memcached.tar.gz \
|
||||
&& docker-php-ext-enable memcached
|
||||
|
||||
# Install xdebug
|
||||
RUN pecl install xdebug \
|
||||
|
@ -2,3 +2,13 @@ date.timezone=UTC
|
||||
display_errors=Off
|
||||
log_errors=On
|
||||
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
|
||||
|
Reference in New Issue
Block a user