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
5635b47c
Commit
5635b47c
authored
Oct 10, 2016
by
Mahmoud Zalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor the workspace docker file
parent
56f422ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
48 deletions
+49
-48
Dockerfile-70
php-fpm/Dockerfile-70
+1
-0
Dockerfile
workspace/Dockerfile
+48
-48
No files found.
php-fpm/Dockerfile-70
View file @
5635b47c
...
...
@@ -34,6 +34,7 @@ MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
# in the `docker-compose.yml` before the build.
# Example:
# - INSTALL_ZIP_ARCHIVE=true
# - ...
#
#####################################
...
...
workspace/Dockerfile
View file @
5635b47c
...
...
@@ -32,13 +32,46 @@ MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
#
# Optional Software's will only be installed if you set them to `true`
# in the `docker-compose.yml` before the build.
# Example:
# - INSTALL_NODE=false
# - ...
#
# - INSTALL_XDEBUG= false
# - INSTALL_MONGO= false
# - COMPOSER_GLOBAL_INSTALL= false
# - INSTALL_NODE= false
# - INSTALL_DRUSH= false
#
#####################################
# Non-Root User:
#####################################
# Add a non-root user to prevent files being created with root permissions on host machine.
ARG
PUID=1000
ARG
PGID=1000
RUN
groupadd
-g
$PGID
laradock
&&
\
useradd
-u
$PUID
-g
laradock
-m
laradock
#####################################
# Composer:
#####################################
# Add the composer.json
COPY
./composer.json /home/laradock/.composer/composer.json
# Make sure that ~/.composer belongs to laradock
RUN
chown
-R
laradock:laradock /home/laradock/.composer
USER
laradock
# Check if global install need to be ran
ARG
COMPOSER_GLOBAL_INSTALL=false
ENV
COMPOSER_GLOBAL_INSTALL ${COMPOSER_GLOBAL_INSTALL}
RUN if
[
${
COMPOSER_GLOBAL_INSTALL
}
=
true
]
;
then
\
# run the install
composer global install \
;fi
#####################################
# Crontab
#####################################
USER
root
COPY
./crontab /var/spool/cron/crontabs
#####################################
# xDebug:
...
...
@@ -57,17 +90,15 @@ RUN if [ ${INSTALL_XDEBUG} = true ]; then \
# ADD for REMOTE debugging
COPY
./xdebug.ini /etc/php/7.0/cli/conf.d/xdebug.ini
#####################################
# ssh:
#####################################
ARG
INSTALL_WORKSPACE_SSH=false
ENV
INSTALL_WORKSPACE_SSH ${INSTALL_WORKSPACE_SSH}
# Check if ssh needs to be installed
# See: https://github.com/phusion/baseimage-docker#enabling_ssh
ADD
insecure_id_rsa /tmp/id_rsa
ADD
insecure_id_rsa.pub /tmp/id_rsa.pub
ARG
INSTALL_WORKSPACE_SSH=false
ENV
INSTALL_WORKSPACE_SSH ${INSTALL_WORKSPACE_SSH}
RUN if
[
${
INSTALL_WORKSPACE_SSH
}
=
true
]
;
then
\
rm
-f
/etc/service/sshd/down
&&
\
cat
/tmp/id_rsa.pub
>>
/root/.ssh/authorized_keys
\
...
...
@@ -78,7 +109,6 @@ RUN if [ ${INSTALL_WORKSPACE_SSH} = true ]; then \
&&
chmod
400 /root/.ssh/id_rsa
\
;
fi
#####################################
# MongoDB:
#####################################
...
...
@@ -92,35 +122,6 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \
echo "extension=mongodb.so" >> /etc/php/7.0/cli/php.ini \
;fi
#####################################
# Non-Root User:
#####################################
# Add a non-root user to prevent files being created with root permissions on host machine.
ARG
PUID=1000
ARG
PGID=1000
RUN
groupadd
-g
$PGID
laradock
&&
\
useradd
-u
$PUID
-g
laradock
-m
laradock
#####################################
# Composer:
#####################################
# Add the composer.json
COPY
./composer.json /home/laradock/.composer/composer.json
# Make sure that ~/.composer belongs to laradock
RUN
chown
-R
laradock:laradock /home/laradock/.composer
USER
laradock
# Check if global install need to be ran
ARG
COMPOSER_GLOBAL_INSTALL=false
ENV
COMPOSER_GLOBAL_INSTALL ${COMPOSER_GLOBAL_INSTALL}
RUN if
[
${
COMPOSER_GLOBAL_INSTALL
}
=
true
]
;
then
\
# run the install
composer global install \
;fi
#####################################
# Drush:
#####################################
...
...
@@ -167,6 +168,7 @@ RUN if [ ${INSTALL_NODE} = true ]; then \
# Add NVM binaries to root's .bashrc
USER
root
RUN if
[
${
INSTALL_NODE
}
=
true
]
;
then
\
echo
""
>>
~/.bashrc
&&
\
echo
'export NVM_DIR="/home/laradock/.nvm"'
>>
~/.bashrc
&&
\
...
...
@@ -177,10 +179,13 @@ RUN if [ ${INSTALL_NODE} = true ]; then \
# PHP Aerospike:
#####################################
USER
root
ARG
INSTALL_AEROSPIKE_EXTENSION=false
ARG
INSTALL_AEROSPIKE_EXTENSION=true
ENV
INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION}
# Copy aerospike configration for remote debugging
COPY
./aerospike.ini /etc/php/7.0/cli/conf.d/aerospike.ini
RUN if
[
${
INSTALL_AEROSPIKE_EXTENSION
}
=
true
]
;
then
\
# Install the php aerospike extension
curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/luciano-jr/aerospike-client-php/archive/master.tar.gz" \
...
...
@@ -194,16 +199,11 @@ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \
) \
&& rm /tmp/aerospike-client-php.tar.gz \
;fi
RUN if
[
${
INSTALL_AEROSPIKE_EXTENSION
}
=
false
]
;
then
\
rm
/etc/php/7.0/cli/conf.d/aerospike.ini
\
;
fi
#####################################
# Crontab
#####################################
USER
root
COPY
./crontab /var/spool/cron/crontabs
#
#--------------------------------------------------------------------------
# Final Touch
...
...
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