Compare commits

...

13 Commits

Author SHA1 Message Date
99fb1b4169 Merge pull request #474 from AliveCorpse/master
Fix load of mongodb library
2016-12-12 13:37:13 -05:00
6c9d5866b4 Merge pull request #477 from thebrubaker/patch-1
Update Readme.md
2016-12-12 08:58:27 +08:00
e8ef7ab8c9 Update Readme.md
Very small grammar updates.
2016-12-11 14:41:10 -08:00
5da5d5e29c Merge pull request #476 from jbaron-mx/master
Fix typos and missing commas in docs
2016-12-11 10:34:58 -05:00
19a2110b06 Fix typos and missing commas in docs 2016-12-10 22:22:40 -06:00
2fab33d4e4 Fix load of mongodb library
```
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/mongodb.so' - /usr/lib/php/20151012/mongodb.so: undefined symbol: php_json_serializable_ce in Unknown on line 0
```
2016-12-09 21:13:04 +02:00
4f819c238c Merge pull request #451 from Blaasvis/master
Update MySQL startup script
2016-11-28 22:53:32 -05:00
d8875cb588 Update startup 2016-11-28 21:25:52 +01:00
bb9f65eb2a Merge pull request #445 from danielabbatt/patch-1
Update README.md
2016-11-26 01:33:50 +08:00
d6508f3bb3 Update README.md
Fixed typo on "environment"
2016-11-25 16:59:13 +00:00
a3288462a8 Merge pull request #434 from dlnsk/Fixes
Fixes for nginx and mysql
2016-11-25 01:51:25 -05:00
6bbd1fbe19 Use mysql 5.7 with disabled option ONLY_FULL_GROUP_BY (which causes many problem to people) 2016-11-16 16:16:52 +07:00
d703c82c46 Exclude sites configuration from image and just use volume 2016-11-16 15:58:42 +07:00
9 changed files with 47 additions and 41 deletions

View File

@ -5,7 +5,7 @@ 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).
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 believe 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

View File

@ -6,7 +6,7 @@
Laradock is a Docker PHP development environment. It facilitate running **PHP** Apps on **Docker**.
Laradock is configured to run Laravel Apps by default, and it can be modifyed to run all kinds of PHP Apps (Symfony, Codeigniter, Wordpress, Drupal...).
Laradock is configured to run Laravel Apps by default, and it can be modified to run all kinds of PHP Apps (Symfony, CodeIgniter, Wordpress, Drupal...).
>Use Docker first and learn about it later.
@ -41,7 +41,7 @@ Laradock is configured to run Laravel Apps by default, and it can be modifyed to
- [Change the PHP-FPM Version](#Change-the-PHP-FPM-Version)
- [Change the PHP-CLI Version](#Change-the-PHP-CLI-Version)
- [Install xDebug](#Install-xDebug)
- [Start/Stop xDebug](#Controll-xDebug)
- [Start/Stop xDebug](#Control-xDebug)
- [Production](#Production)
- [Prepare LaraDock for Production](#LaraDock-for-Production)
- [Setup Laravel and Docker on Digital Ocean](#Digital-Ocean)
@ -53,8 +53,8 @@ Laradock is configured to run Laravel Apps by default, and it can be modifyed to
- [Use phpMyAdmin](#Use-phpMyAdmin)
- [Use pgAdmin](#Use-pgAdmin)
- [Use ElasticSearch](#Use-ElasticSearch)
- [Codeigniter](#Codeigniter):
- [Install Codeigniter](#Install-Codeigniter)
- [CodeIgniter](#CodeIgniter):
- [Install CodeIgniter](#Install-CodeIgniter)
- [Misc](#Misc)
- [Change the timezone](#Change-the-timezone)
- [Cron jobs](#CronJobs)
@ -173,7 +173,7 @@ Most importantly Docker can run on Development and on Production (same environme
> Laradock It's like Laravel Homestead but for Docker instead of Vagrant.
Laradock and [Homestead](https://laravel.com/docs/master/homestead) both gives you a complete virtual development environments. (Without the need to install and configure every single software on your own Operating System).
Laradock and [Homestead](https://laravel.com/docs/master/homestead) both give you complete virtual development environments. (Without the need to install and configure every single software on your own Operating System).
- Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine.
@ -214,7 +214,7 @@ Choose the setup the best suits your needs.
*(In case you want a Docker environment for each project)*
##### A.1) Setup environment in existing Project:
*(In case you already have a project, and you want to setup an environemnt to run it)*
*(In case you already have a project, and you want to setup an environment to run it)*
1 - Clone this repository on your project root directory:
@ -393,7 +393,7 @@ If you need a special support. Contact me, more details in the [Help & Questions
```bash
docker ps
```
You can also use the this command if you want to see only this project containers:
You can also use the following command if you want to see only this project containers:
```bash
docker-compose ps
@ -438,9 +438,9 @@ docker-compose down
<a name="Enter-Container"></a>
### Enter a Container (run commands in a running Container)
1 - first list the current running containers with `docker ps`
1 - First list the current running containers with `docker ps`
2 - enter any container using:
2 - Enter any container using:
```bash
docker-compose exec {container-name} bash
@ -452,7 +452,7 @@ docker-compose exec {container-name} bash
docker-compose exec mysql bash
```
3 - to exit a container, type `exit`.
3 - To exit a container, type `exit`.
@ -597,7 +597,7 @@ The PHP-CLI extensions should be installed in `workspace/Dockerfile`.
### Change the (PHP-FPM) Version
By default **PHP-FPM 7.0** is running.
>The PHP-FPM is responsible of serving your application code, you don't have to change the PHP-CLI version if you are planing to run your application on different PHP-FPM version.
>The PHP-FPM is responsible of serving your application code, you don't have to change the PHP-CLI version if you are planning to run your application on different PHP-FPM version.
#### A) Switch from PHP `7.0` to PHP `5.6`
@ -656,7 +656,7 @@ We do not natively support PHP 5.5 anymore, but you can get it in few steps:
### Change the PHP-CLI Version
By default **PHP-CLI 7.0** is running.
>Note: it's not very essential to edit the PHP-CLI verion. The PHP-CLI is only used for the Artisan Commands & Composer. It doesn't serve your Application code, this is the PHP-FPM job.
>Note: it's not very essential to edit the PHP-CLI version. The PHP-CLI is only used for the Artisan Commands & Composer. It doesn't serve your Application code, this is the PHP-FPM job.
The PHP-CLI is installed in the Workspace container. To change the PHP-CLI version you need to edit the `workspace/Dockerfile`.
@ -712,12 +712,12 @@ For information on how to configure xDebug with your IDE and work it out, check
<br>
<a name="Controll-xDebug"></a>
<a name="Control-xDebug"></a>
### Start/Stop xDebug:
By installing xDebug, you are enabling it to run on startup by default.
To controll the behavior of xDebug (in the `php-fpm` Container), you can run the following commands from the LaraDock root folder, (at the same prompt where you run docker-compose):
To control the behavior of xDebug (in the `php-fpm` Container), you can run the following commands from the LaraDock root folder, (at the same prompt where you run docker-compose):
- Stop xDebug from running by default: `./xdebugPhpFpm stop`.
- Start xDebug by default: `./xdebugPhpFpm start`.
@ -737,7 +737,7 @@ To controll the behavior of xDebug (in the `php-fpm` Container), you can run the
<a name="LaraDock-for-Production"></a>
### Prepare LaraDock for Production
It's recommended for production to create a custom `docker-compose.yml` file. For that reason LaraDock is shipped with `production-docker-compose.yml` which should contain only the containers you are planning to run on production (usage exampe: `docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...`).
It's recommended for production to create a custom `docker-compose.yml` file. For that reason, LaraDock is shipped with `production-docker-compose.yml` which should contain only the containers you are planning to run on production (usage exampe: `docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...`).
Note: The Database (MySQL/MariaDB/...) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:
@ -797,7 +797,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:
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` with `../my-cool-app/:/var/www`, as follow:
@ -814,7 +814,7 @@ 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.
5 - Go back to the LaraDock installation steps to see how to edit the `.env` file.
@ -873,7 +873,7 @@ docker-compose up -d redis
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 `redis` for Redis like this:
If you don't find the `REDIS_HOST` variable in your `.env` file. Go to the database configuration file `config/database.php` and replace the default `127.0.0.1` IP with `redis` for Redis like this:
```php
'redis' => [
@ -953,7 +953,7 @@ docker-compose up -d mongo
```
4 - Add the MongoDB configurations to the `config/database.php` config file:
4 - Add the MongoDB configurations to the `config/database.php` configuration file:
```php
'connections' => [
@ -1065,15 +1065,15 @@ docker restart {container-name}
<br>
<a name="Codeigniter"></a>
<a name="CodeIgniter"></a>
<br>
<a name="Install-Codeigniter"></a>
### Install Codeigniter
<a name="Install-CodeIgniter"></a>
### Install CodeIgniter
To install Codeigniter 3 on Laradock all you have to do is the following simple steps:
To install CodeIgniter 3 on Laradock all you have to do is the following simple steps:
1 - Open the `docker-compose.yml` file.
@ -1175,7 +1175,7 @@ Modify the `mysql/my.cnf` file to set your port number, `1234` is used as an exa
port=1234
```
If you need <a href="#MySQL-access-from-host">MySQL access from your host</a>, do not forget to change the internal port number (`"3306:3306"` -> `"3306:1234"`) in the docker-compose config file.
If you need <a href="#MySQL-access-from-host">MySQL access from your host</a>, do not forget to change the internal port number (`"3306:3306"` -> `"3306:1234"`) in the docker-compose configuration file.
<a name="Use-custom-Domain"></a>
### Use custom Domain (instead of the Docker IP)
@ -1191,7 +1191,7 @@ Assuming your custom domain is `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:
Optionally you can define the server name in the nginx configuration file, like this:
```conf
server_name laravel.dev;
@ -1205,9 +1205,9 @@ server_name laravel.dev;
Enabling Global Composer Install during the build for the container allows you to get your composer requirements installed and available in the container after the build is done.
1 - open the `docker-compose.yml` file
1 - Open the `docker-compose.yml` file
2 - search for the `COMPOSER_GLOBAL_INSTALL` argument under the Workspace Container and set it to `true`
2 - Search for the `COMPOSER_GLOBAL_INSTALL` argument under the Workspace Container and set it to `true`
It should be like this:
@ -1219,9 +1219,9 @@ It should be like this:
- COMPOSER_GLOBAL_INSTALL=true
...
```
3 - now add your dependencies to `workspace/composer.json`
3 - Now add your dependencies to `workspace/composer.json`
4 - rebuild the Workspace Container `docker-compose build workspace`
4 - Re-build the Workspace Container `docker-compose build workspace`
@ -1238,11 +1238,11 @@ Click on this [Enable Global Composer Build Install](#Enable-Global-Composer-Bui
2 - Add prestissimo as requirement in Composer:
a - now open the `workspace/composer.json` file
a - Now open the `workspace/composer.json` file
b - add `"hirak/prestissimo": "^0.3"` as requirement
b - Add `"hirak/prestissimo": "^0.3"` as requirement
c - rebuild the Workspace Container `docker-compose build workspace`
c - Re-build the Workspace Container `docker-compose build workspace`
@ -1378,7 +1378,7 @@ Make sure the ports for the services that you are trying to run (22, 80, 443, 33
#### I get Mysql connection refused
This error is sometimes happens because your Laravel application isn't running on the container localhost IP (Which is 127.0.0.1). Steps to fix it:
This error sometimes happens because your Laravel application isn't running on the container localhost IP (Which is 127.0.0.1). Steps to fix it:
* Option A
1. Check your running Laravel application IP by dumping `Request::ip()` variable using `dd(Request::ip())` anywhere on your application. The result is the IP of your Laravel container.
@ -1414,7 +1414,7 @@ Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requ
<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 :)
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 the [Contribution Guidelines](https://github.com/LaraDock/laradock/blob/master/CONTRIBUTING.md).

View File

@ -75,6 +75,7 @@ services:
- applications
volumes:
- ./logs/nginx/:/var/log/nginx
- ./nginx/sites/:/etc/nginx/sites-available
ports:
- "80:80"
- "443:443"

View File

@ -1,4 +1,4 @@
FROM mysql:5.6
FROM mysql:5.7
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>

View File

@ -4,3 +4,6 @@
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
[mysql]
[mysqld]
sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

View File

@ -1,3 +1,4 @@
DROP USER 'homestead';
CREATE DATABASE IF NOT EXISTS MYSQL_DATABASE;
GRANT ALL ON `MYSQL_DATABASE`.* TO 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD';
DROP USER IF EXISTS 'MYSQL_USER';
CREATE USER 'MYSQL_USER'@'%';
CREATE DATABASE IF NOT EXISTS MYSQL_DATABASE;
GRANT ALL ON MYSQL_DATABASE.* TO 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD';

View File

@ -3,7 +3,6 @@ FROM nginx:alpine
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
ADD nginx.conf /etc/nginx/
COPY sites/*.conf /etc/nginx/sites-available/
ARG PHP_UPSTREAM=php-fpm

2
nginx/sites/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.conf
!default.conf

View File

@ -125,7 +125,7 @@ ENV INSTALL_MONGO ${INSTALL_MONGO}
RUN if [ ${INSTALL_MONGO} = true ]; then \
# Install the mongodb extension
pecl install mongodb && \
echo "extension=mongodb.so" >> /etc/php/7.0/cli/php.ini \
echo "extension=mongodb.so" >> /etc/php/7.0/cli/conf.d/30-mongodb.ini \
;fi
#####################################