Skip to content

Commit 5b5ba53

Browse files
authored
Merge pull request laradock#17 from laradock/master
Just update the fork project
2 parents bd87a26 + a94f089 commit 5b5ba53

7 files changed

Lines changed: 209 additions & 18 deletions

File tree

README.md

Lines changed: 63 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
[![Gitter](https://badges.gitter.im/LaraDock/laradock.svg)](https://gitter.im/LaraDock/laradock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
66

7-
Laradock is a Docker PHP development environment. It facilitate running **PHP** Apps on **Docker**.
7+
Laradock is a Docker PHP development environment. It facilitate running **PHP** Apps on **Docker**.
88

99
>Use Docker first and learn about it later.
1010
@@ -87,6 +87,8 @@ Laradock is configured to run Laravel Apps by default, and it can be modified to
8787
- [Install Prestissimo](#Install-Prestissimo)
8888
- [Install Node + NVM](#Install-Node)
8989
- [Install Node + YARN](#Install-Yarn)
90+
- [Install Linuxbrew](#Install-Linuxbrew)
91+
- [Common Terminal Aliases](#Common-Aliases)
9092
- [Debugging](#debugging)
9193
- [Upgrading LaraDock](#upgrading-laradock)
9294
- [Related Projects](#related-projects)
@@ -101,13 +103,13 @@ Laradock is configured to run Laravel Apps by default, and it can be modified to
101103

102104
Let's see how easy it is to install `NGINX`, `PHP`, `Composer`, `MySQL`, `Redis` and `Beanstalkd`:
103105

104-
1 - Clone Laradock inside your PHP project:
106+
1 - Clone Laradock inside your PHP project:
105107

106108
```shell
107109
git clone https://github.com/Laradock/laradock.git
108110
```
109111

110-
2 - Enter the laradock folder and run this command:
112+
2 - Enter the laradock folder and run this command:
111113

112114
```shell
113115
docker-compose up -d nginx mysql redis beanstalkd
@@ -188,12 +190,14 @@ That's it! enjoy :)
188190
- PHP7-CLI
189191
- Composer
190192
- Git
193+
- Linuxbrew
191194
- Node
192195
- Gulp
193196
- SQLite
194197
- xDebug
195198
- Envoy
196199
- Vim
200+
- Yarn
197201
- ... Many other supported tools are not documented. (Will be updated soon)
198202
199203
>If you can't find your Software, build it yourself and add it to this list. Contributions are welcomed :)
@@ -316,7 +320,7 @@ Note: In this case the folder structure will be like this:
316320
- myProject
317321
```
318322
319-
2 - Edit the `docker-compose.yml` file to map to your project directory once you have it (example: `- ../myProject:/var/www`).
323+
2 - Edit the `docker-compose.yml` file to map to your project directory once you have it (example: `- ../myProject:/var/www`).
320324
321325
3 - Stop and re-run your docker-compose command for the changes to take place.
322326
@@ -409,7 +413,8 @@ You can select your own combination of Containers form the list below:
409413
```bash
410414
docker-compose exec workspace bash
411415
```
412-
Alternatively, for Windows Powershell users: execute the following command to enter any running container:
416+
417+
Alternativey, for Windows Powershell users: execute the following command to enter any running container:
413418
414419
```bash
415420
docker exec -it {workspace-container-id} bash
@@ -798,7 +803,7 @@ To control the behavior of xDebug (in the `php-fpm` Container), you can run the
798803
<a name="LaraDock-for-Production"></a>
799804
### Prepare LaraDock for Production
800805
801-
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 ...`).
806+
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 ...`).
802807

803808
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:
804809

@@ -1213,15 +1218,15 @@ docker-compose up -d rethinkdb
12131218

12141219
```php
12151220
'connections' => [
1216-
1221+
12171222
'rethinkdb' => [
12181223
'name' => 'rethinkdb',
12191224
'driver' => 'rethinkdb',
12201225
'host' => env('DB_HOST', 'rethinkdb'),
12211226
'port' => env('DB_PORT', 28015),
1222-
'database' => env('DB_DATABASE', 'test'),
1227+
'database' => env('DB_DATABASE', 'test'),
12231228
]
1224-
1229+
12251230
// ...
12261231
12271232
],
@@ -1319,7 +1324,7 @@ Make sure you [change the timezone](#Change-the-timezone) if you don't want to u
13191324
<br>
13201325
<a name="Workspace-ssh"></a>
13211326
### Access workspace via ssh
1322-
1327+
13231328
You can access the `workspace` container through `localhost:2222` by setting the `INSTALL_WORKSPACE_SSH` build argument to `true`.
13241329

13251330
To change the default forwarded port for ssh:
@@ -1378,7 +1383,7 @@ The default username and password for the root mysql user are `root` and `root `
13781383
Modify the `mysql/my.cnf` file to set your port number, `1234` is used as an example.
13791384

13801385
```
1381-
[mysqld]
1386+
[mysqld]
13821387
port=1234
13831388
```
13841389

@@ -1524,6 +1529,45 @@ It should be like this:
15241529

15251530

15261531

1532+
<br>
1533+
<a name="Install-Linuxbrew"></a>
1534+
### Install Linuxbrew
1535+
1536+
Linuxbrew is a package manager for Linux. It is the Linux version of MacOS Homebrew and can be found [here](http://linuxbrew.sh). To install Linuxbrew in the Workspace container:
1537+
1538+
1 - Open the `docker-compose.yml` file
1539+
1540+
2 - Search for the `INSTALL_LINUXBREW` argument under the Workspace Container and set it to `true`
1541+
1542+
It should be like this:
1543+
1544+
```yml
1545+
workspace:
1546+
build:
1547+
context: ./workspace
1548+
args:
1549+
- INSTALL_LINUXBREW=true
1550+
...
1551+
```
1552+
1553+
3 - Re-build the container `docker-compose build workspace`
1554+
1555+
1556+
1557+
1558+
1559+
<br>
1560+
<a name="Common-Aliases"></a>
1561+
<br>
1562+
### Common Terminal Aliases
1563+
When you start your docker container, Laradock will copy the `aliases.sh` file located in the `laradock/workspace` directory and add sourcing to the container `~/.bashrc` file.
1564+
1565+
You are free to modify the `aliases.sh` as you see fit, adding your own aliases (or function macros) to suit your requirements.
1566+
1567+
1568+
1569+
1570+
15271571
<br>
15281572
<a name="Install-Aerospike-Extension"></a>
15291573
### Install Aerospike extension
@@ -1659,14 +1703,20 @@ Make sure the ports for the services that you are trying to run (22, 80, 443, 33
16591703
16601704
#### I get Nginx error 404 Not Found on Windows.
16611705
1662-
1. Go to docker Settings on your Windows machine.
1706+
1. Go to docker Settings on your Windows machine.
16631707
2. Click on the `Shared Drives` tab and check the drive that contains your project files.
16641708
3. Enter your windows username and password.
16651709
4. Go to the `reset` tab and click restart docker.
16661710
16671711
16681712
16691713
1714+
#### The time in my services does not match the current time
1715+
1716+
1. Make sure you've [changed the timezone](#Change-the-timezone).
1717+
2. Stop and rebuild the containers (`docker-compose up -d --build <services>`)
1718+
1719+
16701720

16711721

16721722
#### I get Mysql connection refused
@@ -1695,7 +1745,7 @@ Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requ
16951745
3. Upgrade LaraDock to `v4.*.*` (`git pull origin master`)
16961746
4. Use LaraDock as you used to do: `docker-compose up -d nginx mysql`.
16971747
1698-
**Note:** If you face any problem with the last step above: rebuild all your containers
1748+
**Note:** If you face any problem with the last step above: rebuild all your containers
16991749
`docker-compose build --no-cache`
17001750
"Warnning Containers Data might be lost!"
17011751

docker-compose.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ services:
2626
- COMPOSER_GLOBAL_INSTALL=false
2727
- INSTALL_WORKSPACE_SSH=false
2828
- INSTALL_LARAVEL_ENVOY=false
29+
- INSTALL_LINUXBREW=false
2930
- PUID=1000
3031
- PGID=1000
3132
- NODE_VERSION=stable
@@ -53,6 +54,7 @@ services:
5354
- INSTALL_BCMATH=false
5455
- INSTALL_MEMCACHED=false
5556
- INSTALL_OPCACHE=false
57+
- INSTALL_EXIF=false
5658
- INSTALL_AEROSPIKE_EXTENSION=false
5759
- CODEIGNITER=false
5860
dockerfile: Dockerfile-70
@@ -118,7 +120,7 @@ services:
118120
### MySQL Container #########################################
119121

120122
mysql:
121-
build:
123+
build:
122124
context: ./mysql
123125
args:
124126
- MYSQL_DATABASE=homestead
@@ -135,7 +137,7 @@ services:
135137
mariadb:
136138
build: ./mariadb
137139
volumes:
138-
- mysql:/var/lib/mysql
140+
- mariadb:/var/lib/mysql
139141
ports:
140142
- "3306:3306"
141143
environment:
@@ -190,7 +192,7 @@ services:
190192
- "27017:27017"
191193
volumes:
192194
- mongo:/data/db
193-
195+
194196
### RethinkDB Container #######################################
195197

196198
rethinkdb:

php-fpm/Dockerfile-70

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,17 @@ RUN if [ ${INSTALL_XDEBUG} = true ]; then \
6060
docker-php-ext-enable xdebug \
6161
;fi
6262

63+
#####################################
64+
# PHP REDIS EXTENSION FOR PHP 7.0
65+
#####################################
66+
ARG INSTALL_PHPREDIS=false
67+
RUN if [ ${INSTALL_PHPREDIS} = true ]; then \
68+
# Install Php Redis Extension
69+
pecl install -o -f redis \
70+
&& rm -rf /tmp/pear \
71+
&& docker-php-ext-enable redis \
72+
;fi
73+
6374
# Copy xdebug configration for remote debugging
6475
COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
6576

@@ -117,6 +128,18 @@ RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
117128
&& docker-php-ext-enable memcached \
118129
;fi
119130

131+
#####################################
132+
# Exif:
133+
#####################################
134+
135+
ARG INSTALL_EXIF=false
136+
RUN if [ ${INSTALL_EXIF} = true ]; then \
137+
# Enable Exif PHP extentions requirements
138+
docker-php-ext-install exif && \
139+
docker-php-ext-enable exif \
140+
;fi
141+
142+
120143
#####################################
121144
# PHP Aerospike:
122145
#####################################

workspace/Dockerfile

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,19 @@ RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \
7979
#####################################
8080
USER root
8181

82-
COPY ./crontab /var/spool/cron/crontabs
82+
COPY ./crontab /etc/cron.d
83+
RUN chmod -R 644 /etc/cron.d
84+
85+
#####################################
86+
# User Aliases
87+
#####################################
88+
USER root
89+
90+
COPY ./aliases.sh /home/laradock/aliases.sh
91+
RUN echo "" >> ~/.bashrc
92+
RUN echo "# Load Custom Aliases" >> ~/.bashrc
93+
RUN echo "source /home/laradock/aliases.sh" >> ~/.bashrc
94+
RUN echo "" >> ~/.bashrc
8395

8496
#####################################
8597
# xDebug:
@@ -291,6 +303,39 @@ RUN if [ ${INSTALL_LARAVEL_ENVOY} = true ]; then \
291303
&& composer global require "laravel/envoy=~1.0" \
292304
;fi
293305

306+
#####################################
307+
# Linuxbrew:
308+
#####################################
309+
USER root
310+
311+
ARG INSTALL_LINUXBREW=true
312+
ENV INSTALL_LINUXBREW ${INSTALL_LINUXBREW}
313+
314+
RUN if [ ${INSTALL_LINUXBREW} = true ]; then \
315+
316+
# Preparation
317+
apt-get update && \
318+
apt-get upgrade -y && \
319+
apt-get install -y build-essential make cmake scons curl git \
320+
ruby autoconf automake autoconf-archive \
321+
gettext libtool flex bison \
322+
libbz2-dev libcurl4-openssl-dev \
323+
libexpat-dev libncurses-dev && \
324+
325+
# Install the Linuxbrew
326+
git clone https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew && \
327+
328+
echo "" >> ~/.bashrc && \
329+
echo 'export PKG_CONFIG_PATH"=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.bashrc && \
330+
331+
# Setup linuxbrew
332+
echo 'export LINUXBREWHOME="$HOME/.linuxbrew"' >> ~/.bashrc && \
333+
echo 'export PATH="$LINUXBREWHOME/bin:$PATH"' >> ~/.bashrc && \
334+
echo 'export MANPATH="$LINUXBREWHOME/man:$MANPATH"' >> ~/.bashrc && \
335+
echo 'export PKG_CONFIG_PATH="$LINUXBREWHOME/lib64/pkgconfig:$LINUXBREWHOME/lib/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.bashrc && \
336+
echo 'export LD_LIBRARY_PATH="$LINUXBREWHOME/lib64:$LINUXBREWHOME/lib:$LD_LIBRARY_PATH"' >> ~/.bashrc \
337+
;fi
338+
294339
#
295340
#--------------------------------------------------------------------------
296341
# Final Touch

0 commit comments

Comments
 (0)