Compare commits

...

45 Commits

Author SHA1 Message Date
fc303dee08 Merge pull request #151 from computerfr33k/issue-147
Fix Memcached extension not installing
2016-07-18 23:55:18 +03:00
d75a43c615 Update Dockerfile-70
fixes memcached extension not installing
2016-07-16 13:07:56 -05:00
06337e6024 Merge pull request #144 from appleboy/patch-7
#140 update php 5.5 and 5.6
2016-07-14 15:29:54 +03:00
16b82d066e #140 update php 5.5 and 5.6
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-07-14 09:56:05 +08:00
074deec781 Merge branch 'master' of https://github.com/LaraDock/laradock
* 'master' of https://github.com/LaraDock/laradock:
  fix the volumes mapping
2016-07-14 04:28:12 +03:00
2d382b683a general updates to the readme 2016-07-14 04:27:45 +03:00
68576f9022 fix the volumes mapping 2016-07-13 17:04:06 +03:00
2df00ecdad remove installing Prestissimo by default, to prevent the warning 2016-07-13 16:00:47 +03:00
aeb5a6bb63 Merge pull request #140 from yewjs/patch-1
Update Dockerfile-70
2016-07-13 15:50:31 +03:00
2bbf59ddda Merge pull request #139 from Kauhat/master
Database volume mapping changes & documentation
2016-07-13 15:47:17 +03:00
dca0545293 Fixed incorrect php-fpm container mapping 2016-07-13 10:44:17 +01:00
5f99478c76 Fixed workspace container mapping volumes to wrong container 2016-07-13 10:08:13 +01:00
48a53f1d24 Update Dockerfile-70
install libJPEG and enabled in GD
2016-07-13 14:12:32 +08:00
11cdfd440b Updated README
References #135
2016-07-12 17:52:06 +01:00
14cbe9f935 Moved volume container definitions
I've placed the `application` and `data` directories into a `volumes`
subdirectory. The top level `data` directory is now used for storing the
data used by the database (and other, if any) containers. The `data`
directory has also been added to the `.gitignore` file to prevent
accidental pushing of user data.
2016-07-12 17:11:57 +01:00
42d63236f1 Changed the data container volume mappings
All of the database data volume mapping have been changed from the host's
`/var/lib` directory to locally alongside the laradock installation. This
should hopefully prevent issues where data disappears after containers are
restarted or data on the host machine is overwritten by accident (scary!)

Additionally this should make data easier to backup between installations
- especially on Windows where `/var` does not exist and is created
  transparently by Docker Machine/Windows beta.

This change will most likely cause data to disappear from existing
installations, however it may reappear if moved to it's new home.

References #137, #138
2016-07-12 16:39:08 +01:00
d01d087431 Added more detail to the README 2016-07-12 16:38:20 +01:00
11c65c4a00 Fix variable not set warning
Added an untracked `.env` file to the root directory to prevent the
`WARNING: The INSTALL_PRESTISSIMO variable is not set` message from being
displayed when `docker-compose` is run.

Added section in README for optional features.
2016-07-12 16:27:55 +01:00
1b9630e8a1 Merge pull request #132 from Niksac/fix-readme
Update README.md
2016-07-07 21:39:26 +03:00
3a714339da Update README.md 2016-07-07 15:29:00 +02:00
65078505c1 Merge pull request #123 from appleboy/patch-6
Added support upload file size setting.
2016-06-28 16:06:29 +03:00
e0b4734dab Added support upload file size setting.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-06-28 17:18:37 +08:00
243392444f Merge pull request #122 from LaraDock/Hotfix/mongo
Hotfix/mongo
2016-06-27 14:00:09 +03:00
72a8fc049d Merge branch 'zhikiri-hotfix/mongo-support'
* zhikiri-hotfix/mongo-support:
  Fix conflict merging zhikiri-hotfix/mongo-support
2016-06-27 13:59:24 +03:00
de6db93da8 Fix conflict merging zhikiri-hotfix/mongo-support 2016-06-27 13:58:48 +03:00
1af9dc5ac2 Merge pull request #121 from zhikiri/feature/mcrypt-extension
Added supporting of the mcrypt extenstion
2016-06-27 13:45:37 +03:00
62878e7c49 Added supporting of the mcrypt extenstion 2016-06-27 11:30:25 +03:00
3cd1f070e1 Merge pull request #118 from appleboy/patch-5
remove duplicate white spaces
2016-06-25 20:38:54 +03:00
fb5ea7f42c remove duplicate white spaces
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-06-25 19:40:36 +08:00
aa8be6f95b list the contributors names in the readme
@benmag @mattythebatty @AminMkh @appleboy
2016-06-25 07:36:03 +03:00
aa0a726945 change enter container commands in the doc
`docker-compose run …` to `docker exec -it …`
2016-06-25 07:33:30 +03:00
e5e04e4e18 update the readme: exec command to run 2016-06-23 08:58:43 +03:00
44d8720400 Merge pull request #115 from appleboy/patch-2
Change command about enter workspace container.
2016-06-23 08:52:37 +03:00
f0200626ba Merge pull request #114 from Kauhat/master
Added support to conditionally install Prestissimo
2016-06-23 08:36:48 +03:00
69406db3e0 Change command about enter workspace container. 2016-06-23 13:16:52 +08:00
bcb749151a Added support to conditionally install Prestissimo 2016-06-22 21:47:06 +01:00
ca413edff4 Merge pull request #112 from appleboy/patch-2
Fixed Change wrong project name.
2016-06-22 17:21:05 +03:00
f6d1d6f617 Fixed Change wrong project name. 2016-06-22 22:20:24 +08:00
117382a050 Merge branch 'pr/111'
(fix conflict)
* pr/111:
  add Node Version Manager (nvm)
2016-06-22 17:18:23 +03:00
2e930df2a7 Merge pull request #109 from appleboy/composer
Load xdebug Zend extension with phpunit command.
2016-06-22 16:57:08 +03:00
4922c5fafd add Node Version Manager (nvm)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-06-22 09:33:17 +08:00
198c38f6cd Load xdebug Zend extension with phpunit command.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-06-21 14:03:39 +08:00
8d216f83d5 Merge pull request #101 from appleboy/gd
Support gd extension.
2016-06-16 17:47:04 +03:00
05c5fcf216 Support gd extension.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-06-16 14:57:27 +08:00
fccee522c6 update the readme 2016-06-11 20:49:04 +03:00
12 changed files with 226 additions and 134 deletions

1
.env Normal file
View File

@ -0,0 +1 @@
INSTALL_PRESTISSIMO=false

2
.gitignore vendored
View File

@ -1 +1,3 @@
/logs /logs
/data
.env

View File

@ -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.
![](http://s18.postimg.org/fhykchl09/new_laradock_cover.png) ![](http://s18.postimg.org/fhykchl09/new_laradock_cover.png)
@ -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,7 @@ 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) - 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)*
@ -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. 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,10 +141,9 @@ 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**.
@ -150,16 +151,12 @@ Running a virtual Container is much faster than running a full virtual Machine.
## 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
@ -191,15 +188,14 @@ git clone https://github.com/LaraDock/laradock.git
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 +203,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`, `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`.
@ -256,6 +256,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>
@ -515,13 +516,6 @@ Composer update
phpunit phpunit
``` ```
<br> <br>
<a name="Use-Redis"></a> <a name="Use-Redis"></a>
### Use Redis ### Use Redis
@ -624,7 +618,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`.
@ -826,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> <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 +867,23 @@ Additionally, you can contact Mahmoud Zalt (the creator of this project) via a d
## Credits ## Credits
**Creator:**
- [Mahmoud Zalt](https://github.com/Mahmoudz) (Twitter [@Mahmoud_Zalt](https://twitter.com/Mahmoud_Zalt)) - [Mahmoud Zalt](https://github.com/Mahmoudz) (Twitter [@Mahmoud_Zalt](https://twitter.com/Mahmoud_Zalt))
- [Awesome list of contributors](https://github.com/LaraDock/laradock/graphs/contributors)
**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

View File

@ -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,32 @@ 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
### Add more Containers below ############################### ### Add more Containers below ###############################

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 \
@ -45,37 +47,40 @@ RUN apt-get update && apt-get install -y --force-yes \
git \ git \
curl \ curl \
vim \ vim \
nano \ nano
nodejs \
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 +88,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