Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
laradock
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kerwin
laradock
Commits
062b7466
Commit
062b7466
authored
Jul 25, 2016
by
Mahmoud Zalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add composer.json to install global composer dependencies
parent
e1dbb972
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
27 deletions
+83
-27
README.md
README.md
+38
-14
docker-compose.yml
docker-compose.yml
+1
-1
Dockerfile
workspace/Dockerfile
+39
-12
composer.json
workspace/composer.json
+5
-0
No files found.
README.md
View file @
062b7466
...
...
@@ -53,6 +53,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
)
-
[
Enable Global Composer Build Install
](
#Enable-Global-Composer-Build-Install
)
-
[
Install Prestissimo
](
#Install-Prestissimo
)
-
[
Install Node + NVM
](
#Install-Node
)
-
[
Debugging
](
#debugging
)
...
...
@@ -608,7 +609,7 @@ It should be like this:
...
```
2 - Re-build the containers
docker-compose build workspace php-fpm
2 - Re-build the containers
`docker-compose build workspace php-fpm`
...
...
@@ -800,9 +801,7 @@ It should be like this:
...
```
2 - Re-build the containers docker-compose build workspace php-fpm
3 - Use it
2 - Re-build the containers
`docker-compose build workspace php-fpm`
...
...
@@ -906,17 +905,16 @@ 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.
<br>
<a
name=
"Enable-Global-Composer-Build-Install"
></a>
### Enable Global Composer Build Install
To
install Prestissimo in the Workspace container
To
enable Running Global Composer Install during the Build:
1 -
O
pen the
`docker-compose.yml`
file
1 -
o
pen the
`docker-compose.yml`
file
2 -
Search for the
`INSTALL_PRESTISSIMO
`
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:
...
...
@@ -925,11 +923,37 @@ It should be like this:
build
:
context
:
./workspace
args
:
-
INSTALL_PRESTISSIMO
=true
-
COMPOSER_GLOBAL_INSTALL
=true
...
```
3 - now add your dependencies to
`workspace/composer.json`
4 - rebuild the Workspace Container
`docker-compose build workspace`
<br>
<a
name=
"Install-Prestissimo"
></a>
### Install Prestissimo
[
Prestissimo
](
https://github.com/hirak/prestissimo
)
is a plugin for composer which enables parallel install functionality.
1 - Enable Running Global Composer Install during the Build:
Click on this
[
Enable Global Composer Build Install
](
#Enable-Global-Composer-Build-Install
)
and do steps 1 and 2 only then continue here.
2 - Add prestissimo as requirement in Composer:
a - now open the
`workspace/composer.json`
file
b - add
`"hirak/prestissimo": "^0.3"`
as requirement
c - rebuild the Workspace Container
`docker-compose build workspace`
3 - Re-build the container docker-compose build workspace
<a
name=
"Install-Node"
></a>
### Install Node + NVM
...
...
@@ -951,7 +975,7 @@ It should be like this:
...
```
3 - Re-build the container
docker-compose build workspace
3 - Re-build the container
`docker-compose build workspace`
<br>
<a
name=
"debugging"
></a>
...
...
docker-compose.yml
View file @
062b7466
...
...
@@ -11,7 +11,7 @@ services:
-
INSTALL_MONGO=false
-
INSTALL_XDEBUG=false
-
INSTALL_NODE=false
-
INSTALL_PRESTISSIMO
=false
-
COMPOSER_GLOBAL_INSTALL
=false
volumes_from
:
-
volumes_source
tty
:
true
...
...
workspace/Dockerfile
View file @
062b7466
...
...
@@ -59,44 +59,71 @@ RUN apt-get update && \
nano
\
&&
apt-get clean
# Composer: Install composer and add its bin to the PATH.
#####################################
# Composer:
#####################################
# Install composer and add its bin to the PATH.
RUN
curl
-s
http://getcomposer.org/installer | php
&&
\
echo
"export PATH=
${
PATH
}
:/var/www/laravel/vendor/bin"
>>
~/.bashrc
&&
\
mv
composer.phar /usr/local/bin/composer
ARG
INSTALL_PRESTISSIMO=true
ENV
INSTALL_PRESTISSIMO ${INSTALL_PRESTISSIMO}
# Add the composer.json
ADD
./composer.json /root/.composer/composer.json
# Check if global install need to be runned
ARG
COMPOSER_GLOBAL_INSTALL=true
ENV
COMPOSER_GLOBAL_INSTALL ${COMPOSER_GLOBAL_INSTALL}
RUN if
[
${
INSTALL_PRESTISSIMO
}
=
true
]
;
then
\
#
Prestissimo: Install Prestissimo (A Composer parallel install plugin)
composer global
require "hirak/prestissimo:^0.3"
\
#
run the install
composer global
install
\
;fi
#####################################
# MongoDB:
#####################################
# Check if Mongo needs to be installed
ARG
INSTALL_MONGO=true
ENV
INSTALL_MONGO ${INSTALL_MONGO}
RUN if
[
${
INSTALL_MONGO
}
=
true
]
;
then
\
#
MongoDB:
Install the mongodb extension
# 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/php.ini \
;fi
#####################################
# xDebug:
#####################################
# Check if xDebug needs to be installed
ARG
INSTALL_XDEBUG=true
ENV
INSTALL_XDEBUG ${INSTALL_XDEBUG}
RUN if
[
${
INSTALL_XDEBUG
}
=
true
]
;
then
\
#
XDebug:
Load the xdebug extension only with phpunit commands
# Load the xdebug extension only with phpunit commands
apt-get install -y --force-yes php7.0-xdebug && \
sed -i 's/^/;/g' /etc/php/7.0/cli/conf.d/20-xdebug.ini && \
echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/laravel/vendor/bin/phpunit'" >> ~/.bashrc \
sed -i 's/^/;/g' /etc/php/7.0/cli/conf.d/20-xdebug.ini && \
echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/laravel/vendor/bin/phpunit'" >> ~/.bashrc \
;fi
#####################################
# Node / NVM:
#####################################
# Check if NVM needs to be installed
ARG
INSTALL_NODE=true
ENV
INSTALL_NODE ${INSTALL_NODE}
RUN if
[
${
INSTALL_NODE
}
=
true
]
;
then
\
#
Node: Install nvm (A Node Version Manager) and use it to install NodeJS
#
Install nvm (A Node Version Manager)
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash \
;fi
# Again check if NVM needs to be installed
# I had to split this condifiton link this because when I get it inside the above if statment is refuses to work!
ENV
if [ ${INSTALL_NODE} = true ]; then \
#
I had to split this condifiton link this because when I get it inside the above if statment is refuses to work!
#
Set the ENV
NVM_DIR=/root/.nvm \
# Install NodeJS with NVM
RUN . ~/.nvm/nvm.sh && \
nvm install stable && \
nvm use stable && \
...
...
workspace/composer.json
0 → 100644
View file @
062b7466
{
"require"
:
{
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment