Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
6288935884 | |||
c5e2e7e1e2 | |||
e9d4e5579e | |||
5d2761bc92 | |||
43b9515b61 | |||
a94f08920a | |||
b52dcd4a19 |
54
README.md
54
README.md
@ -87,7 +87,9 @@ Laradock is configured to run Laravel Apps by default, and it can be modified to
|
||||
- [Install Prestissimo](#Install-Prestissimo)
|
||||
- [Install Node + NVM](#Install-Node)
|
||||
- [Install Node + YARN](#Install-Yarn)
|
||||
- [Install Linuxbrew](#Install-Brew)
|
||||
- [Install Linuxbrew](#Install-Linuxbrew)
|
||||
- [Common Terminal Aliases](#Common-Aliases)
|
||||
- [Install Deployer](#Install-Deployer)
|
||||
- [Debugging](#debugging)
|
||||
- [Upgrading LaraDock](#upgrading-laradock)
|
||||
- [Related Projects](#related-projects)
|
||||
@ -189,12 +191,15 @@ That's it! enjoy :)
|
||||
- PHP7-CLI
|
||||
- Composer
|
||||
- Git
|
||||
- Linuxbrew
|
||||
- Node
|
||||
- Gulp
|
||||
- SQLite
|
||||
- xDebug
|
||||
- Envoy
|
||||
- Deployer
|
||||
- Vim
|
||||
- Yarn
|
||||
- ... Many other supported tools are not documented. (Will be updated soon)
|
||||
|
||||
>If you can't find your Software, build it yourself and add it to this list. Contributions are welcomed :)
|
||||
@ -410,7 +415,8 @@ You can select your own combination of Containers form the list below:
|
||||
```bash
|
||||
docker-compose exec workspace bash
|
||||
```
|
||||
Alternatively, for Windows Powershell users: execute the following command to enter any running container:
|
||||
|
||||
Alternativey, for Windows Powershell users: execute the following command to enter any running container:
|
||||
|
||||
```bash
|
||||
docker exec -it {workspace-container-id} bash
|
||||
@ -1552,6 +1558,17 @@ It should be like this:
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Common-Aliases"></a>
|
||||
<br>
|
||||
### Common Terminal Aliases
|
||||
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.
|
||||
|
||||
You are free to modify the `aliases.sh` as you see fit, adding your own aliases (or function macros) to suit your requirements.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Install-Aerospike-Extension"></a>
|
||||
@ -1622,16 +1639,41 @@ It should be like this:
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
<a name="Install-Deployer"></a>
|
||||
### Install Deployer (Deployment tool for PHP)
|
||||
|
||||
1 - Open the `docker-compose.yml` file
|
||||
<br>
|
||||
2 - Search for the `INSTALL_DEPLOYER` argument under the Workspace Container
|
||||
<br>
|
||||
3 - Set it to `true`
|
||||
<br>
|
||||
|
||||
It should be like this:
|
||||
|
||||
```yml
|
||||
workspace:
|
||||
build:
|
||||
context: ./workspace
|
||||
args:
|
||||
- INSTALL_DEPLOYER=true
|
||||
...
|
||||
```
|
||||
|
||||
4 - Re-build the containers `docker-compose build workspace`
|
||||
|
||||
####[Deployer Documentation Here](https://deployer.org/docs)
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
<a name="debugging"></a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### PHPStorm
|
||||
Remote debug Laravel web and phpunit tests.
|
||||
|
||||
|
@ -26,6 +26,7 @@ services:
|
||||
- COMPOSER_GLOBAL_INSTALL=false
|
||||
- INSTALL_WORKSPACE_SSH=false
|
||||
- INSTALL_LARAVEL_ENVOY=false
|
||||
- INSTALL_DEPLOYER=false
|
||||
- INSTALL_LINUXBREW=false
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
@ -52,8 +53,10 @@ services:
|
||||
- INSTALL_MONGO=false
|
||||
- INSTALL_ZIP_ARCHIVE=false
|
||||
- INSTALL_BCMATH=false
|
||||
- INSTALL_PHPREDIS=false
|
||||
- INSTALL_MEMCACHED=false
|
||||
- INSTALL_OPCACHE=false
|
||||
- INSTALL_EXIF=false
|
||||
- INSTALL_AEROSPIKE_EXTENSION=false
|
||||
- CODEIGNITER=false
|
||||
dockerfile: Dockerfile-70
|
||||
|
@ -15,6 +15,8 @@ server {
|
||||
try_files $uri /index.php =404;
|
||||
fastcgi_pass php-upstream;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_buffers 16 16k;
|
||||
fastcgi_buffer_size 32k;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
@ -128,6 +128,18 @@ RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
|
||||
&& docker-php-ext-enable memcached \
|
||||
;fi
|
||||
|
||||
#####################################
|
||||
# Exif:
|
||||
#####################################
|
||||
|
||||
ARG INSTALL_EXIF=false
|
||||
RUN if [ ${INSTALL_EXIF} = true ]; then \
|
||||
# Enable Exif PHP extentions requirements
|
||||
docker-php-ext-install exif && \
|
||||
docker-php-ext-enable exif \
|
||||
;fi
|
||||
|
||||
|
||||
#####################################
|
||||
# PHP Aerospike:
|
||||
#####################################
|
||||
|
@ -1,62 +0,0 @@
|
||||
version: '2'
|
||||
|
||||
services:
|
||||
|
||||
### Workspace Utilities Container ###########################
|
||||
|
||||
workspace:
|
||||
build:
|
||||
context: ./workspace
|
||||
args:
|
||||
- INSTALL_XDEBUG=false
|
||||
- INSTALL_MONGO=false
|
||||
- INSTALL_NODE=false
|
||||
- INSTALL_YARN=false
|
||||
- INSTALL_DRUSH=false
|
||||
- INSTALL_AEROSPIKE_EXTENSION=false
|
||||
- COMPOSER_GLOBAL_INSTALL=false
|
||||
- INSTALL_WORKSPACE_SSH=false
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- NODE_VERSION=stable
|
||||
volumes_from:
|
||||
- volumes_source
|
||||
ports:
|
||||
- "22:22"
|
||||
tty: true
|
||||
|
||||
### PHP-FPM Container #######################################
|
||||
|
||||
php-fpm:
|
||||
build:
|
||||
context: ./php-fpm
|
||||
args:
|
||||
- INSTALL_XDEBUG=false
|
||||
- INSTALL_MONGO=false
|
||||
- INSTALL_ZIP_ARCHIVE=false
|
||||
- INSTALL_MEMCACHED=false
|
||||
- INSTALL_OPCACHE=false
|
||||
- INSTALL_AEROSPIKE_EXTENSION=false
|
||||
dockerfile: Dockerfile-70
|
||||
volumes_from:
|
||||
- volumes_source
|
||||
expose:
|
||||
- "9000"
|
||||
links:
|
||||
- workspace
|
||||
|
||||
### Application Code Container ######################
|
||||
|
||||
volumes_source:
|
||||
image: tianon/true
|
||||
volumes:
|
||||
- ../:/var/www
|
||||
|
||||
### Databases Data Container ################################
|
||||
|
||||
volumes_data:
|
||||
image: tianon/true
|
||||
volumes:
|
||||
# - ./data/mysql:/var/lib/mysql
|
||||
|
||||
### Add All your Software Containers below ###############################
|
@ -74,6 +74,10 @@ RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \
|
||||
composer global install \
|
||||
;fi
|
||||
|
||||
# Export composer vendor path
|
||||
RUN echo "" >> ~/.bashrc && \
|
||||
echo 'export PATH="~/.composer/vendor/bin:$PATH"' >> ~/.bashrc
|
||||
|
||||
#####################################
|
||||
# Crontab
|
||||
#####################################
|
||||
@ -82,6 +86,23 @@ USER root
|
||||
COPY ./crontab /etc/cron.d
|
||||
RUN chmod -R 644 /etc/cron.d
|
||||
|
||||
#####################################
|
||||
# User Aliases
|
||||
#####################################
|
||||
|
||||
USER laradock
|
||||
COPY ./aliases.sh /home/laradock/aliases.sh
|
||||
RUN echo "" >> ~/.bashrc && \
|
||||
echo "# Load Custom Aliases" >> ~/.bashrc && \
|
||||
echo "source /home/laradock/aliases.sh" >> ~/.bashrc && \
|
||||
echo "" >> ~/.bashrc
|
||||
|
||||
USER root
|
||||
RUN echo "" >> ~/.bashrc && \
|
||||
echo "# Load Custom Aliases" >> ~/.bashrc && \
|
||||
echo "source /home/laradock/aliases.sh" >> ~/.bashrc && \
|
||||
echo "" >> ~/.bashrc
|
||||
|
||||
#####################################
|
||||
# xDebug:
|
||||
#####################################
|
||||
@ -287,9 +308,20 @@ ENV INSTALL_LARAVEL_ENVOY ${INSTALL_LARAVEL_ENVOY}
|
||||
|
||||
RUN if [ ${INSTALL_LARAVEL_ENVOY} = true ]; then \
|
||||
# Install the Laravel Envoy
|
||||
echo "" >> ~/.bashrc && \
|
||||
echo 'export PATH="~/.composer/vendor/bin:$PATH"' >> ~/.bashrc \
|
||||
&& composer global require "laravel/envoy=~1.0" \
|
||||
composer global require "laravel/envoy=~1.0" \
|
||||
;fi
|
||||
|
||||
#####################################
|
||||
# Deployer:
|
||||
#####################################
|
||||
USER laradock
|
||||
|
||||
ARG INSTALL_DEPLOYER=false
|
||||
ENV INSTALL_DEPLOYER ${INSTALL_DEPLOYER}
|
||||
|
||||
RUN if [ ${INSTALL_DEPLOYER} = true ]; then \
|
||||
# Install the Deployer
|
||||
composer global require "deployer/deployer" \
|
||||
;fi
|
||||
|
||||
#####################################
|
||||
|
71
workspace/aliases.sh
Normal file
71
workspace/aliases.sh
Normal file
@ -0,0 +1,71 @@
|
||||
#! /bin/sh
|
||||
|
||||
# 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"
|
||||
|
||||
# Commonly Used Aliases
|
||||
alias ..="cd .."
|
||||
alias c="clear"
|
||||
alias cla="clear && ls -l"
|
||||
alias cll="clear && ls -la"
|
||||
alias cls="clear && ls"
|
||||
alias code="cd /var/www"
|
||||
alias ea="vi ~/aliases"
|
||||
alias g="gulp"
|
||||
alias home="cd ~"
|
||||
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"
|
||||
|
||||
# Laravel / PHP Alisases
|
||||
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 migrate="php artisan migrate"
|
||||
alias seed="php artisan:seed"
|
||||
alias phpunit="./vendor/bin/phpunit"
|
||||
|
||||
|
||||
# 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"
|
||||
|
||||
|
||||
# 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'
|
||||
}
|
Reference in New Issue
Block a user