* big pre-summer refactoring
+ introduce php7.4 and stay only php7.3 as max older version + workspace with php7.4 in future commits
This commit is contained in:
475
dockerfiles/workspace73/Dockerfile
Normal file
475
dockerfiles/workspace73/Dockerfile
Normal file
@ -0,0 +1,475 @@
|
||||
#
|
||||
#--------------------------------------------------------------------------
|
||||
# Image Setup
|
||||
#--------------------------------------------------------------------------
|
||||
#
|
||||
# To edit the 'workspace' base Image, visit its repository on Github
|
||||
# https://github.com/Laradock/workspace
|
||||
#
|
||||
# To change its version, see the available Tags on the Docker Hub:
|
||||
# https://hub.docker.com/r/laradock/workspace/tags/
|
||||
#
|
||||
# Note: Base Image name format {image-tag}-{php-version}
|
||||
#
|
||||
|
||||
ARG PHP_VERSION
|
||||
|
||||
# FROM laradock/workspace:2.2-${PHP_VERSION}
|
||||
FROM letsdockerize/laradock-workspace:2.4-${PHP_VERSION}
|
||||
|
||||
LABEL maintainer="WP Studio <info@wpstudio.ru>"
|
||||
|
||||
# Set Environment Variables
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# Start as root
|
||||
USER root
|
||||
|
||||
###########################################################################
|
||||
# Laradock non-root user:
|
||||
###########################################################################
|
||||
|
||||
# Add a non-root user to prevent files being created with root permissions on host machine.
|
||||
ARG PUID=1000
|
||||
ENV PUID ${PUID}
|
||||
ARG PGID=1000
|
||||
ENV PGID ${PGID}
|
||||
|
||||
# always run apt update when start and after add new source list, then clean up at end.
|
||||
RUN set -xe; \
|
||||
apt-get update -yqq && \
|
||||
pecl channel-update pecl.php.net && \
|
||||
groupadd -g ${PGID} laradock && \
|
||||
useradd -u ${PUID} -g laradock -m laradock -G docker_env && \
|
||||
usermod -p "*" laradock -s /bin/bash && \
|
||||
apt-get install -yqq \
|
||||
apt-utils \
|
||||
#
|
||||
#--------------------------------------------------------------------------
|
||||
# Mandatory Software's Installation
|
||||
#--------------------------------------------------------------------------
|
||||
#
|
||||
# Mandatory Software's such as ("php-cli", "git", "vim", ....) are
|
||||
# installed on the base image 'laradock/workspace' image. If you want
|
||||
# to add more Software's or remove existing one, you need to edit the
|
||||
# base image (https://github.com/Laradock/workspace).
|
||||
#
|
||||
# next lines are here becase there is no auto build on dockerhub see https://github.com/laradock/laradock/pull/1903#issuecomment-463142846
|
||||
libzip-dev zip unzip \
|
||||
# Install the zip extension
|
||||
php${PHP_VERSION}-zip \
|
||||
# nasm
|
||||
nasm && \
|
||||
php -m | grep -q 'zip'
|
||||
|
||||
#
|
||||
#--------------------------------------------------------------------------
|
||||
# Optional Software's Installation
|
||||
#--------------------------------------------------------------------------
|
||||
#
|
||||
# Optional Software's will only be installed if you set them to `true`
|
||||
# in the `docker-compose.yml` before the build.
|
||||
# Example:
|
||||
# - WORKSPACE_INSTALL_NODE=false
|
||||
# - ...
|
||||
#
|
||||
|
||||
###########################################################################
|
||||
# Set Timezone
|
||||
###########################################################################
|
||||
|
||||
ARG TZ=Europe/Moscow
|
||||
ENV TZ ${TZ}
|
||||
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
###########################################################################
|
||||
# User Aliases
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
COPY ./aliases.sh /root/aliases.sh
|
||||
COPY ./aliases.sh /home/laradock/aliases.sh
|
||||
|
||||
RUN sed -i 's/\r//' /root/aliases.sh && \
|
||||
sed -i 's/\r//' /home/laradock/aliases.sh && \
|
||||
chown laradock:laradock /home/laradock/aliases.sh && \
|
||||
echo "" >> ~/.bashrc && \
|
||||
echo "# Load Custom Aliases" >> ~/.bashrc && \
|
||||
echo "source ~/aliases.sh" >> ~/.bashrc && \
|
||||
echo "" >> ~/.bashrc
|
||||
|
||||
USER laradock
|
||||
|
||||
RUN echo "" >> ~/.bashrc && \
|
||||
echo "# Load Custom Aliases" >> ~/.bashrc && \
|
||||
echo "source ~/aliases.sh" >> ~/.bashrc && \
|
||||
echo "" >> ~/.bashrc
|
||||
|
||||
###########################################################################
|
||||
# MySQL Client:
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
ARG INSTALL_MYSQL_CLIENT=false
|
||||
|
||||
RUN if [ ${INSTALL_MYSQL_CLIENT} = true ]; then \
|
||||
apt-get update -yqq && \
|
||||
apt-get -y install mysql-client \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# Composer:
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
# Add the composer.json
|
||||
COPY ./composer.json /home/laradock/.composer/composer.json
|
||||
|
||||
# Add the auth.json for magento 2 credentials
|
||||
COPY ./auth.json /home/laradock/.composer/auth.json
|
||||
|
||||
# Make sure that ~/.composer belongs to laradock
|
||||
RUN chown -R laradock:laradock /home/laradock/.composer
|
||||
|
||||
# Export composer vendor path
|
||||
RUN echo "" >> ~/.bashrc && \
|
||||
echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"' >> ~/.bashrc
|
||||
|
||||
# Update composer
|
||||
ARG COMPOSER_VERSION=2
|
||||
ENV COMPOSER_VERSION ${COMPOSER_VERSION}
|
||||
RUN composer self-update --${COMPOSER_VERSION}
|
||||
|
||||
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
|
||||
|
||||
# Check if auth file is disabled
|
||||
ARG COMPOSER_AUTH=false
|
||||
ENV COMPOSER_AUTH ${COMPOSER_AUTH}
|
||||
|
||||
RUN if [ ${COMPOSER_AUTH} = false ]; then \
|
||||
# remove the file
|
||||
rm /home/laradock/.composer/auth.json \
|
||||
;fi
|
||||
|
||||
ARG COMPOSER_REPO_PACKAGIST
|
||||
ENV COMPOSER_REPO_PACKAGIST ${COMPOSER_REPO_PACKAGIST}
|
||||
|
||||
RUN if [ ${COMPOSER_REPO_PACKAGIST} ]; then \
|
||||
composer config -g repo.packagist composer ${COMPOSER_REPO_PACKAGIST} \
|
||||
;fi
|
||||
|
||||
# Export composer vendor path
|
||||
RUN echo "" >> ~/.bashrc && \
|
||||
echo 'export PATH="~/.composer/vendor/bin:$PATH"' >> ~/.bashrc
|
||||
|
||||
###########################################################################
|
||||
# Non-root user : PHPUnit path
|
||||
###########################################################################
|
||||
|
||||
# add ./vendor/bin to non-root user's bashrc (needed for phpunit)
|
||||
USER laradock
|
||||
|
||||
RUN echo "" >> ~/.bashrc && \
|
||||
echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc
|
||||
|
||||
###########################################################################
|
||||
# Check PHP version:
|
||||
###########################################################################
|
||||
|
||||
RUN set -xe; php -v | head -n 1 | grep -q "PHP ${PHP_VERSION}."
|
||||
|
||||
###########################################################################
|
||||
# MySQL Client:
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
ARG INSTALL_MYSQL_CLIENT=false
|
||||
|
||||
RUN if [ ${INSTALL_MYSQL_CLIENT} = true ]; then \
|
||||
apt-get update -yqq && \
|
||||
apt-get -y install mysql-client \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# ping:
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
ARG INSTALL_PING=false
|
||||
|
||||
RUN if [ ${INSTALL_PING} = true ]; then \
|
||||
apt-get update -yqq && \
|
||||
apt-get -y install inetutils-ping \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# PYTHON:
|
||||
###########################################################################
|
||||
|
||||
ARG INSTALL_PYTHON=false
|
||||
|
||||
RUN if [ ${INSTALL_PYTHON} = true ]; then \
|
||||
apt-get -y install python python-pip python-dev build-essential \
|
||||
&& python -m pip install --upgrade "pip < 21.0" \
|
||||
&& python -m pip install --upgrade virtualenv \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# Crontab
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
COPY ./crontab /etc/cron.d
|
||||
|
||||
RUN chmod -R 644 /etc/cron.d
|
||||
|
||||
###########################################################################
|
||||
# WP CLI:
|
||||
###########################################################################
|
||||
|
||||
# The command line interface for WordPress
|
||||
|
||||
USER root
|
||||
|
||||
ARG INSTALL_WP_CLI=false
|
||||
|
||||
RUN if [ ${INSTALL_WP_CLI} = true ]; then \
|
||||
curl -fsSL -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | bash && \
|
||||
chmod +x /usr/local/bin/wp \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# xDebug:
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
ARG INSTALL_XDEBUG=false
|
||||
|
||||
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
|
||||
# Load the xdebug extension only with phpunit commands
|
||||
apt-get install -y php${PHP_VERSION}-xdebug && \
|
||||
sed -i 's/^;//g' /etc/php/${PHP_VERSION}/cli/conf.d/20-xdebug.ini && \
|
||||
echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/vendor/bin/phpunit'" >> ~/.bashrc \
|
||||
;fi
|
||||
|
||||
# ADD for REMOTE debugging
|
||||
COPY ./xdebug.ini /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini
|
||||
|
||||
RUN sed -i "s/xdebug.remote_autostart=0/xdebug.remote_autostart=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini && \
|
||||
sed -i "s/xdebug.remote_enable=0/xdebug.remote_enable=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini && \
|
||||
sed -i "s/xdebug.cli_color=0/xdebug.cli_color=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Additional PHP-extensions:
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
RUN pecl install igbinary \
|
||||
&& pecl install -a redis
|
||||
|
||||
###########################################################################
|
||||
# ssh:
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
ARG INSTALL_SSH=false
|
||||
ENV INSTALL_SSH ${INSTALL_SSH}
|
||||
|
||||
ARG SSH_PASSPHRAZE=
|
||||
ENV SSH_PASSPHRAZE ${SSH_PASSPHRAZE}
|
||||
|
||||
RUN ssh-keygen -f /tmp/id_rsa -N '${SSH_PASSPHRAZE}'
|
||||
|
||||
RUN if [ ${INSTALL_SSH} = true ]; then \
|
||||
rm -f /etc/service/sshd/down && \
|
||||
cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys \
|
||||
&& cat /tmp/id_rsa.pub >> /root/.ssh/id_rsa.pub \
|
||||
&& cat /tmp/id_rsa >> /root/.ssh/id_rsa \
|
||||
&& rm -f /tmp/id_rsa* \
|
||||
&& chmod 644 /root/.ssh/authorized_keys /root/.ssh/id_rsa.pub \
|
||||
&& chmod 400 /root/.ssh/id_rsa \
|
||||
&& cp -rf /root/.ssh /home/laradock \
|
||||
&& chown -R laradock:laradock /home/laradock/.ssh \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# fswatch
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
ARG INSTALL_FSWATCH=false
|
||||
|
||||
RUN if [ ${INSTALL_FSWATCH} = true ]; then \
|
||||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 47FE03C1 \
|
||||
&& add-apt-repository -y ppa:hadret/fswatch \
|
||||
|| apt-get update -yqq \
|
||||
&& apt-get -y install fswatch \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# Node / NVM:
|
||||
###########################################################################
|
||||
|
||||
USER laradock
|
||||
|
||||
# Check if NVM needs to be installed
|
||||
ARG INSTALL_NODE=false
|
||||
ENV INSTALL_NODE ${INSTALL_NODE}
|
||||
ARG NODE_VERSION=node
|
||||
ENV NODE_VERSION ${NODE_VERSION}
|
||||
ARG INSTALL_NPM_GULP=false
|
||||
ARG INSTALL_NPM_BOWER=false
|
||||
ARG INSTALL_NPM_VUE_CLI=false
|
||||
ARG INSTALL_NPM_ANGULAR_CLI=false
|
||||
ARG NPM_REGISTRY
|
||||
ENV NPM_REGISTRY ${NPM_REGISTRY}
|
||||
ENV NVM_DIR /home/laradock/.nvm
|
||||
|
||||
RUN if [ ${INSTALL_NODE} = true ]; then \
|
||||
# Install nvm (A Node Version Manager)
|
||||
mkdir -p $NVM_DIR && \
|
||||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash \
|
||||
&& . $NVM_DIR/nvm.sh \
|
||||
&& nvm install ${NODE_VERSION} \
|
||||
&& nvm use ${NODE_VERSION} \
|
||||
&& nvm alias ${NODE_VERSION} \
|
||||
&& if [ ${NPM_REGISTRY} ]; then \
|
||||
npm config set registry ${NPM_REGISTRY} \
|
||||
;fi \
|
||||
&& if [ ${INSTALL_NPM_GULP} = true ]; then \
|
||||
npm install -g gulp \
|
||||
;fi \
|
||||
&& if [ ${INSTALL_NPM_BOWER} = true ]; then \
|
||||
npm install -g bower \
|
||||
;fi \
|
||||
&& if [ ${INSTALL_NPM_VUE_CLI} = true ]; then \
|
||||
npm install -g @vue/cli \
|
||||
;fi \
|
||||
&& if [ ${INSTALL_NPM_ANGULAR_CLI} = true ]; then \
|
||||
npm install -g @angular/cli \
|
||||
;fi \
|
||||
&& ln -s `npm bin --global` /home/laradock/.node-bin \
|
||||
;fi
|
||||
|
||||
# Wouldn't execute when added to the RUN statement in the above block
|
||||
# Source NVM when loading bash since ~/.profile isn't loaded on non-login shell
|
||||
RUN if [ ${INSTALL_NODE} = true ]; then \
|
||||
echo "" >> ~/.bashrc && \
|
||||
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc && \
|
||||
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
|
||||
;fi
|
||||
|
||||
# Add NVM binaries to root's .bashrc
|
||||
USER root
|
||||
|
||||
RUN if [ ${INSTALL_NODE} = true ]; then \
|
||||
cp -R /home/laradock/.nvm /root/ && \
|
||||
chown -R root:root /root/.nvm && \
|
||||
echo "" >> ~/.bashrc && \
|
||||
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc && \
|
||||
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
|
||||
;fi
|
||||
|
||||
# Add PATH for node
|
||||
ENV PATH $PATH:/home/laradock/.node-bin
|
||||
|
||||
# Make it so the node modules can be executed with 'docker-compose exec'
|
||||
# We'll create symbolic links into '/usr/local/bin'.
|
||||
RUN if [ ${INSTALL_NODE} = true ]; then \
|
||||
find $NVM_DIR -type f -name node -exec ln -s {} /usr/local/bin/node \; && \
|
||||
NODE_MODS_DIR="$NVM_DIR/versions/node/$(node -v)/lib/node_modules" && \
|
||||
ln -s $NODE_MODS_DIR/bower/bin/bower /usr/local/bin/bower && \
|
||||
ln -s $NODE_MODS_DIR/gulp/bin/gulp.js /usr/local/bin/gulp && \
|
||||
ln -s $NODE_MODS_DIR/npm/bin/npm-cli.js /usr/local/bin/npm && \
|
||||
ln -s $NODE_MODS_DIR/npm/bin/npx-cli.js /usr/local/bin/npx && \
|
||||
ln -s $NODE_MODS_DIR/vue-cli/bin/vue /usr/local/bin/vue && \
|
||||
ln -s $NODE_MODS_DIR/vue-cli/bin/vue-init /usr/local/bin/vue-init && \
|
||||
ln -s $NODE_MODS_DIR/vue-cli/bin/vue-list /usr/local/bin/vue-list \
|
||||
;fi
|
||||
|
||||
RUN if [ ${NPM_REGISTRY} ]; then \
|
||||
. ~/.bashrc && npm config set registry ${NPM_REGISTRY} \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# YARN:
|
||||
###########################################################################
|
||||
|
||||
USER laradock
|
||||
|
||||
ARG INSTALL_YARN=false
|
||||
ARG YARN_VERSION=latest
|
||||
ENV YARN_VERSION ${YARN_VERSION}
|
||||
|
||||
RUN if [ ${INSTALL_YARN} = true ]; then \
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && \
|
||||
if [ ${YARN_VERSION} = "latest" ]; then \
|
||||
curl -o- -L https://yarnpkg.com/install.sh | bash; \
|
||||
else \
|
||||
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION}; \
|
||||
fi && \
|
||||
echo "" >> ~/.bashrc && \
|
||||
echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.bashrc \
|
||||
;fi
|
||||
|
||||
# Add YARN binaries to root's .bashrc
|
||||
USER root
|
||||
|
||||
RUN if [ ${INSTALL_YARN} = true ]; then \
|
||||
echo "" >> ~/.bashrc && \
|
||||
echo 'export YARN_DIR="/home/laradock/.yarn"' >> ~/.bashrc && \
|
||||
echo 'export PATH="$YARN_DIR/bin:$PATH"' >> ~/.bashrc \
|
||||
;fi
|
||||
|
||||
# Add PATH for YARN
|
||||
ENV PATH $PATH:/home/laradock/.yarn/bin
|
||||
|
||||
###########################################################################
|
||||
# GULP:
|
||||
###########################################################################
|
||||
|
||||
ARG INSTALL_GULP=false
|
||||
ENV INSTALL_GULP ${INSTALL_GULP}
|
||||
|
||||
USER root
|
||||
|
||||
RUN if [ ${INSTALL_GULP} = true ]; then \
|
||||
npm i -g gulp gulp-cli \
|
||||
;fi
|
||||
|
||||
#
|
||||
#--------------------------------------------------------------------------
|
||||
# Final Touch
|
||||
#--------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
USER root
|
||||
|
||||
# Clean up
|
||||
RUN apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
|
||||
rm /var/log/lastlog /var/log/faillog
|
||||
|
||||
# Set default work directory
|
||||
WORKDIR /var/www
|
153
dockerfiles/workspace73/aliases.sh
Normal file
153
dockerfiles/workspace73/aliases.sh
Normal file
@ -0,0 +1,153 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Colors used for status updates
|
||||
ESC_SEQ="\x1b["
|
||||
COL_RESET=$ESC_SEQ"39;49;00m"
|
||||
COL_RED=$ESC_SEQ"31;01m"
|
||||
COL_GREEN=$ESC_SEQ"32;01m"
|
||||
COL_YELLOW=$ESC_SEQ"33;01m"
|
||||
COL_BLUE=$ESC_SEQ"34;01m"
|
||||
COL_MAGENTA=$ESC_SEQ"35;01m"
|
||||
COL_CYAN=$ESC_SEQ"36;01m"
|
||||
|
||||
# Detect which `ls` flavor is in use
|
||||
if ls --color > /dev/null 2>&1; then # GNU `ls`
|
||||
colorflag="--color"
|
||||
export LS_COLORS='no=00:fi=00:di=01;31:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
|
||||
else # macOS `ls`
|
||||
colorflag="-G"
|
||||
export LSCOLORS='BxBxhxDxfxhxhxhxhxcxcx'
|
||||
fi
|
||||
|
||||
# List all files colorized in long format
|
||||
#alias l="ls -lF ${colorflag}"
|
||||
### MEGA: I want l and la ti return hisdden files
|
||||
alias l="ls -laF ${colorflag}"
|
||||
|
||||
# List all files colorized in long format, including dot files
|
||||
alias la="ls -laF ${colorflag}"
|
||||
|
||||
# List only directories
|
||||
alias lsd="ls -lF ${colorflag} | grep --color=never '^d'"
|
||||
|
||||
# Always use color output for `ls`
|
||||
alias ls="command ls ${colorflag}"
|
||||
|
||||
# Commonly Used Aliases
|
||||
alias ..="cd .."
|
||||
alias ...="cd ../.."
|
||||
alias ....="cd ../../.."
|
||||
alias .....="cd ../../../.."
|
||||
alias ~="cd ~" # `cd` is probably faster to type though
|
||||
alias -- -="cd -"
|
||||
alias home="cd ~"
|
||||
|
||||
alias h="history"
|
||||
alias j="jobs"
|
||||
alias e='exit'
|
||||
alias c="clear"
|
||||
alias cla="clear && ls -la"
|
||||
alias cll="clear && ls -l"
|
||||
alias cls="clear && ls"
|
||||
alias code="cd /var/www"
|
||||
alias ea="vi ~/aliases.sh"
|
||||
|
||||
# Always enable colored `grep` output
|
||||
# Note: `GREP_OPTIONS="--color=auto"` is deprecated, hence the alias usage.
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
|
||||
alias art="php artisan"
|
||||
alias artisan="php artisan"
|
||||
alias cdump="composer dump-autoload -o"
|
||||
alias composer:dump="composer dump-autoload -o"
|
||||
alias db:reset="php artisan migrate:reset && php artisan migrate --seed"
|
||||
alias dusk="php artisan dusk"
|
||||
alias fresh="php artisan migrate:fresh"
|
||||
alias migrate="php artisan migrate"
|
||||
alias refresh="php artisan migrate:refresh"
|
||||
alias rollback="php artisan migrate:rollback"
|
||||
alias seed="php artisan db:seed"
|
||||
alias serve="php artisan serve --quiet &"
|
||||
|
||||
alias phpunit="./vendor/bin/phpunit"
|
||||
alias pu="phpunit"
|
||||
alias puf="phpunit --filter"
|
||||
alias pud='phpunit --debug'
|
||||
|
||||
alias cc='codecept'
|
||||
alias ccb='codecept build'
|
||||
alias ccr='codecept run'
|
||||
alias ccu='codecept run unit'
|
||||
alias ccf='codecept run functional'
|
||||
|
||||
alias g="gulp"
|
||||
alias npm-global="npm list -g --depth 0"
|
||||
alias ra="reload"
|
||||
alias reload="source ~/.aliases && echo \"$COL_GREEN ==> Aliases Reloaded... $COL_RESET \n \""
|
||||
alias run="npm run"
|
||||
alias tree="xtree"
|
||||
|
||||
# Xvfb
|
||||
alias xvfb="Xvfb -ac :0 -screen 0 1024x768x16 &"
|
||||
|
||||
# requires installation of 'https://www.npmjs.com/package/npms-cli'
|
||||
alias npms="npms search"
|
||||
# requires installation of 'https://www.npmjs.com/package/package-menu-cli'
|
||||
alias pm="package-menu"
|
||||
# requires installation of 'https://www.npmjs.com/package/pkg-version-cli'
|
||||
alias pv="package-version"
|
||||
# requires installation of 'https://github.com/sindresorhus/latest-version-cli'
|
||||
alias lv="latest-version"
|
||||
|
||||
# git aliases
|
||||
alias gaa="git add ."
|
||||
alias gd="git --no-pager diff"
|
||||
alias git-revert="git reset --hard && git clean -df"
|
||||
alias gs="git status"
|
||||
alias whoops="git reset --hard && git clean -df"
|
||||
alias glog="git log --oneline --decorate --graph"
|
||||
alias gloga="git log --oneline --decorate --graph --all"
|
||||
alias gsh="git show"
|
||||
alias grb="git rebase -i"
|
||||
alias gbr="git branch"
|
||||
alias gc="git commit"
|
||||
alias gck="git checkout"
|
||||
alias gull="git pull --rebase"
|
||||
alias gush="git push"
|
||||
|
||||
# Create a new directory and enter it
|
||||
function mkd() {
|
||||
mkdir -p "$@" && cd "$@"
|
||||
}
|
||||
|
||||
function md() {
|
||||
mkdir -p "$@" && cd "$@"
|
||||
}
|
||||
|
||||
function xtree {
|
||||
find ${1:-.} -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
|
||||
}
|
||||
|
||||
# `tre` is a shorthand for `tree` with hidden files and color enabled, ignoring
|
||||
# the `.git` directory, listing directories first. The output gets piped into
|
||||
# `less` with options to preserve color and line numbers, unless the output is
|
||||
# small enough for one screen.
|
||||
function tre() {
|
||||
tree -aC -I '.git|node_modules|bower_components' --dirsfirst "$@" | less -FRNX;
|
||||
}
|
||||
|
||||
# Determine size of a file or total size of a directory
|
||||
function fs() {
|
||||
if du -b /dev/null > /dev/null 2>&1; then
|
||||
local arg=-sbh;
|
||||
else
|
||||
local arg=-sh;
|
||||
fi
|
||||
if [[ -n "$@" ]]; then
|
||||
du $arg -- "$@";
|
||||
else
|
||||
du $arg .[^.]* ./*;
|
||||
fi;
|
||||
}
|
11
dockerfiles/workspace73/auth.json
Normal file
11
dockerfiles/workspace73/auth.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"http-basic": {
|
||||
"repo.magento.com": {
|
||||
"username": "",
|
||||
"password": ""
|
||||
}
|
||||
},
|
||||
"github-oauth": {
|
||||
"github.com": "e12b92ef777d9cfdd43c95a557dce7ffe4ad4407"
|
||||
}
|
||||
}
|
5
dockerfiles/workspace73/composer.json
Normal file
5
dockerfiles/workspace73/composer.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"require": {
|
||||
|
||||
}
|
||||
}
|
1
dockerfiles/workspace73/crontab/laradock
Normal file
1
dockerfiles/workspace73/crontab/laradock
Normal file
@ -0,0 +1 @@
|
||||
* * * * * laradock /usr/bin/php /var/www/artisan schedule:run >> /dev/null 2>&1
|
20
dockerfiles/workspace73/xdebug.ini
Normal file
20
dockerfiles/workspace73/xdebug.ini
Normal file
@ -0,0 +1,20 @@
|
||||
; NOTE: The actual debug.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini)
|
||||
|
||||
xdebug.remote_host=dockerhost
|
||||
xdebug.remote_connect_back=0
|
||||
xdebug.remote_port=9000
|
||||
xdebug.idekey=PHPSTORM
|
||||
|
||||
xdebug.remote_autostart=0
|
||||
xdebug.remote_enable=0
|
||||
xdebug.cli_color=0
|
||||
xdebug.profiler_enable=0
|
||||
xdebug.profiler_output_dir="~/xdebug/phpstorm/tmp/profiling"
|
||||
|
||||
xdebug.remote_handler=dbgp
|
||||
xdebug.remote_mode=req
|
||||
|
||||
xdebug.var_display_max_children=-1
|
||||
xdebug.var_display_max_data=-1
|
||||
xdebug.var_display_max_depth=-1
|
||||
|
101
dockerfiles/workspace73/xdebug.sh
Executable file
101
dockerfiles/workspace73/xdebug.sh
Executable file
@ -0,0 +1,101 @@
|
||||
#! /bin/bash
|
||||
|
||||
# NOTE: At the moment, this has only been confirmed to work with PHP 7
|
||||
|
||||
|
||||
# Grab full name of workspace container
|
||||
WORKSPACE_CONTAINER=$(docker ps | grep workspace | awk '{print $1}')
|
||||
|
||||
|
||||
# Grab OS type
|
||||
if [[ "$(uname)" == "Darwin" ]]; then
|
||||
OS_TYPE="OSX"
|
||||
else
|
||||
OS_TYPE=$(expr substr $(uname -s) 1 5)
|
||||
fi
|
||||
|
||||
|
||||
xdebug_status ()
|
||||
{
|
||||
echo 'xDebug status'
|
||||
|
||||
# If running on Windows, need to prepend with winpty :(
|
||||
if [[ $OS_TYPE == "MINGW" ]]; then
|
||||
winpty docker exec -it $WORKSPACE_CONTAINER bash -c 'php -v'
|
||||
|
||||
else
|
||||
docker exec -it $WORKSPACE_CONTAINER bash -c 'php -v'
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
xdebug_start ()
|
||||
{
|
||||
echo 'Start xDebug'
|
||||
|
||||
# And uncomment line with xdebug extension, thus enabling it
|
||||
ON_CMD="sed -i 's/^;zend_extension=/zend_extension=/g' \
|
||||
/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini"
|
||||
|
||||
|
||||
# If running on Windows, need to prepend with winpty :(
|
||||
if [[ $OS_TYPE == "MINGW" ]]; then
|
||||
winpty docker exec -it $WORKSPACE_CONTAINER bash -c "${ON_CMD}"
|
||||
docker restart $WORKSPACE_CONTAINER
|
||||
winpty docker exec -it $WORKSPACE_CONTAINER bash -c 'php -v'
|
||||
|
||||
else
|
||||
docker exec -it $WORKSPACE_CONTAINER bash -c "${ON_CMD}"
|
||||
docker restart $WORKSPACE_CONTAINER
|
||||
docker exec -it $WORKSPACE_CONTAINER bash -c 'php -v'
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
xdebug_stop ()
|
||||
{
|
||||
echo 'Stop xDebug'
|
||||
|
||||
# Comment out xdebug extension line
|
||||
OFF_CMD="sed -i 's/^zend_extension=/;zend_extension=/g' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini"
|
||||
|
||||
|
||||
# If running on Windows, need to prepend with winpty :(
|
||||
if [[ $OS_TYPE == "MINGW" ]]; then
|
||||
# This is the equivalent of:
|
||||
# winpty docker exec -it laradock_php-fpm_1 bash -c 'bla bla bla'
|
||||
# Thanks to @michaelarnauts at https://github.com/docker/compose/issues/593
|
||||
winpty docker exec -it $WORKSPACE_CONTAINER bash -c "${OFF_CMD}"
|
||||
docker restart $WORKSPACE_CONTAINER
|
||||
#docker-compose restart php-fpm
|
||||
winpty docker exec -it $WORKSPACE_CONTAINER bash -c 'php -v'
|
||||
|
||||
else
|
||||
docker exec -it $WORKSPACE_CONTAINER bash -c "${OFF_CMD}"
|
||||
# docker-compose restart php-fpm
|
||||
docker restart $WORKSPACE_CONTAINER
|
||||
docker exec -it $WORKSPACE_CONTAINER bash -c 'php -v'
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
case $@ in
|
||||
stop|STOP)
|
||||
xdebug_stop
|
||||
;;
|
||||
start|START)
|
||||
xdebug_start
|
||||
;;
|
||||
status|STATUS)
|
||||
xdebug_status
|
||||
;;
|
||||
*)
|
||||
echo "xDebug [Stop | Start | Status] in the ${WORKSPACE_CONTAINER} container."
|
||||
echo "xDebug must have already been installed."
|
||||
echo "Usage:"
|
||||
echo " .php-fpm/xdebug stop|start|status"
|
||||
|
||||
esac
|
||||
|
||||
exit 1
|
Reference in New Issue
Block a user