Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3c66fdecf | ||
|
|
9b8eee6a98 | ||
|
|
668acd66c1 | ||
|
|
b25215684b | ||
|
|
8e84fbbec2 | ||
|
|
1e650d8643 | ||
|
|
4977b0f92f | ||
|
|
2082659fb1 | ||
|
|
1fe2df73e4 | ||
|
|
05c7f9186a | ||
|
|
3801973b15 | ||
|
|
6d89424e91 | ||
|
|
b1c1e6e187 | ||
|
|
972bdd90a3 | ||
|
|
2af40b0ba1 | ||
|
|
5c0b8316b1 | ||
|
|
004e4354aa | ||
|
|
d99cf73bf0 | ||
|
|
a365425c73 | ||
|
|
c836500488 | ||
|
|
318ca3f81c | ||
|
|
82219ededb | ||
|
|
d6ff224b0d | ||
|
|
b1144bba7e | ||
|
|
a590ed78ce | ||
|
|
f852789720 |
28
.github/README.md
vendored
28
.github/README.md
vendored
@@ -1,12 +1,26 @@
|
|||||||

|
<p align="center">
|
||||||
|
<img src="https://s19.postimg.org/jblfytw9f/laradock-logo.jpg" alt="Laradock Logo"/>
|
||||||
|
</p>
|
||||||
|
|
||||||
[](https://travis-ci.org/laradock/laradock) [](https://github.com/laradock/laradock/issues) [](https://github.com/laradock/laradock/network) [](https://github.com/laradock/laradock/stargazers) [](https://raw.githubusercontent.com/laradock/laradock/master/LICENSE)
|
<p align="center">A Docker PHP development environment that facilitates running PHP Apps on Docker</p>
|
||||||
|
|
||||||
> Use Docker first and learn about it later.
|
<p align="center">
|
||||||
|
<a href="https://travis-ci.org/laradock/laradock"><img src="https://travis-ci.org/laradock/laradock.svg?branch=master" alt="Build status"></a>
|
||||||
|
<a href="https://github.com/laradock/laradock/stargazers"><img src="https://img.shields.io/github/stars/laradock/laradock.svg" alt="GitHub stars"></a>
|
||||||
|
<a href="https://github.com/laradock/laradock/network"><img src="https://img.shields.io/github/forks/laradock/laradock.svg" alt="GitHub forks"></a>
|
||||||
|
<a href="https://github.com/laradock/laradock/issues"><img src="https://img.shields.io/github/issues/laradock/laradock.svg" alt="GitHub issues"></a>
|
||||||
|
<a href="https://raw.githubusercontent.com/laradock/laradock/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license"></a>
|
||||||
|
<a href="http://laradock.io/contributing"><img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat" alt="contributions welcome"></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
A Docker PHP development environment that facilitates running **PHP** Apps on **Docker**.
|
<h4 align="center" style="color:#7d58c2">Use Docker First And Learn About It Later</h4>
|
||||||
|
|
||||||
[](http://zalt.me)
|
<p align="center">
|
||||||
|
<a href="https://zalt.me"><img src="http://forthebadge.com/images/badges/built-by-developers.svg" alt="forthebadge" width="240" ></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
@@ -14,8 +28,6 @@ A Docker PHP development environment that facilitates running **PHP** Apps on **
|
|||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
**Maintainers:**
|
|
||||||
|
|
||||||
- [Mahmoud Zalt](https://github.com/Mahmoudz) @mahmoudz | [Twitter](https://twitter.com/Mahmoud_Zalt) | [Site](http://zalt.me)
|
- [Mahmoud Zalt](https://github.com/Mahmoudz) @mahmoudz | [Twitter](https://twitter.com/Mahmoud_Zalt) | [Site](http://zalt.me)
|
||||||
- [Bo-Yi Wu](https://github.com/appleboy) @appleboy | [Twitter](https://twitter.com/appleboy)
|
- [Bo-Yi Wu](https://github.com/appleboy) @appleboy | [Twitter](https://twitter.com/appleboy)
|
||||||
- [Philippe Trépanier](https://github.com/philtrep) @philtrep
|
- [Philippe Trépanier](https://github.com/philtrep) @philtrep
|
||||||
@@ -31,4 +43,4 @@ A Docker PHP development environment that facilitates running **PHP** Apps on **
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
[MIT License](https://github.com/laradock/laradock/blob/master/LICENSE) (MIT)
|
[MIT License](https://github.com/laradock/laradock/blob/master/LICENSE)
|
||||||
|
|||||||
@@ -1021,9 +1021,18 @@ To install CodeIgniter 3 on Laradock all you have to do is the following simple
|
|||||||
3 - Re-build your PHP-FPM Container `docker-compose build php-fpm`.
|
3 - Re-build your PHP-FPM Container `docker-compose build php-fpm`.
|
||||||
|
|
||||||
|
|
||||||
|
<a name="Install-Symfony"></a>
|
||||||
|
## Install Symfony
|
||||||
|
|
||||||
|
1 - Open the `.env` file and set `WORKSPACE_INSTALL_SYMFONY` to `true`.
|
||||||
|
|
||||||
|
2 - Run `docker-compose build workspace`, after the step above.
|
||||||
|
|
||||||
|
3 - The NGINX sites include a default config file for your Symfony project `symfony.conf.example`, so edit it and make sure the `root` is pointing to your project `web` directory.
|
||||||
|
|
||||||
|
4 - Run `docker-compose restart` if the container was already running, before the step above.
|
||||||
|
|
||||||
|
5 - Visit `symfony.dev`
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<a name="Misc"></a>
|
<a name="Misc"></a>
|
||||||
|
|||||||
@@ -112,9 +112,9 @@ Your folder structure should look like this:
|
|||||||
|
|
||||||
2 - Go to `nginx/sites` and create config files to point to different project directory when visiting different domains.
|
2 - Go to `nginx/sites` and create config files to point to different project directory when visiting different domains.
|
||||||
|
|
||||||
Laradock by default includes `project-1.conf` and `project-2.conf` as working samples.
|
Laradock by default includes `app.conf.example`, `laravel.conf.example` and `symfony.conf.example` as working samples.
|
||||||
|
|
||||||
3 - change the default names `project-n`:
|
3 - change the default names `*.conf`:
|
||||||
|
|
||||||
You can rename the config files, project folders and domains as you like, just make sure the `root` in the config files, is pointing to the correct project folder name.
|
You can rename the config files, project folders and domains as you like, just make sure the `root` in the config files, is pointing to the correct project folder name.
|
||||||
|
|
||||||
@@ -123,6 +123,7 @@ You can rename the config files, project folders and domains as you like, just m
|
|||||||
```
|
```
|
||||||
127.0.0.1 project-1.dev
|
127.0.0.1 project-1.dev
|
||||||
127.0.0.1 project-2.dev
|
127.0.0.1 project-2.dev
|
||||||
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Now jump to the [Usage](#Usage) section.**
|
> **Now jump to the [Usage](#Usage) section.**
|
||||||
|
|||||||
@@ -326,6 +326,7 @@ Set the following variables:
|
|||||||
- `laradock/php-fpm/xdebug.ini`
|
- `laradock/php-fpm/xdebug.ini`
|
||||||
|
|
||||||
Set the following variables:
|
Set the following variables:
|
||||||
|
|
||||||
```
|
```
|
||||||
xdebug.remote_autostart=1
|
xdebug.remote_autostart=1
|
||||||
xdebug.remote_enable=1
|
xdebug.remote_enable=1
|
||||||
@@ -336,21 +337,25 @@ xdebug.cli_color=1
|
|||||||
|
|
||||||
<a name="InstallCleanHouse"></a>
|
<a name="InstallCleanHouse"></a>
|
||||||
### Need to clean house first?
|
### Need to clean house first?
|
||||||
|
|
||||||
Make sure you are starting with a clean state. For example, do you have other Laradock containers and images?
|
Make sure you are starting with a clean state. For example, do you have other Laradock containers and images?
|
||||||
Here are a few things I use to clean things up.
|
Here are a few things I use to clean things up.
|
||||||
|
|
||||||
- Delete all containers using `grep laradock_` on the names, see: [Remove all containers based on docker image name](https://linuxconfig.org/remove-all-containners-based-on-docker-image-name).
|
- Delete all containers using `grep laradock_` on the names, see: [Remove all containers based on docker image name](https://linuxconfig.org/remove-all-containners-based-on-docker-image-name).
|
||||||
|
|
||||||
`docker ps -a | awk '{ print $1,$2 }' | grep laradock_ | awk '{print $1}' | xargs -I {} docker rm {}`
|
`docker ps -a | awk '{ print $1,$2 }' | grep laradock_ | awk '{print $1}' | xargs -I {} docker rm {}`
|
||||||
|
|
||||||
- Delete all images containing `laradock`.
|
- Delete all images containing `laradock`.
|
||||||
|
|
||||||
`docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {}`
|
`docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {}`
|
||||||
**Note:** This will only delete images that were built with `Laradock`, **NOT** `laradock/*` which are pulled down by `Laradock` such as `laradock/workspace`, etc.
|
**Note:** This will only delete images that were built with `Laradock`, **NOT** `laradock/*` which are pulled down by `Laradock` such as `laradock/workspace`, etc.
|
||||||
**Note:** Some may fail with:
|
**Note:** Some may fail with:
|
||||||
`Error response from daemon: conflict: unable to delete 3f38eaed93df (cannot be forced) - image has dependent child images`
|
`Error response from daemon: conflict: unable to delete 3f38eaed93df (cannot be forced) - image has dependent child images`
|
||||||
|
|
||||||
- I added this to my `.bashrc` to remove orphaned images.
|
- I added this to my `.bashrc` to remove orphaned images.
|
||||||
```
|
|
||||||
dclean() {
|
```
|
||||||
|
dclean() {
|
||||||
processes=`docker ps -q -f status=exited`
|
processes=`docker ps -q -f status=exited`
|
||||||
if [ -n "$processes" ]; thend
|
if [ -n "$processes" ]; thend
|
||||||
docker rm $processes
|
docker rm $processes
|
||||||
@@ -360,10 +365,11 @@ Here are a few things I use to clean things up.
|
|||||||
if [ -n "$images" ]; then
|
if [ -n "$images" ]; then
|
||||||
docker rmi $images
|
docker rmi $images
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
- If you frequently switch configurations for Laradock, you may find that adding the following and added to your `.bashrc` or equivalent useful:
|
- If you frequently switch configurations for Laradock, you may find that adding the following and added to your `.bashrc` or equivalent useful:
|
||||||
|
|
||||||
```
|
```
|
||||||
# remove laravel* containers
|
# remove laravel* containers
|
||||||
# remove laravel_* images
|
# remove laravel_* images
|
||||||
@@ -406,14 +412,14 @@ laradock_php-fpm_1 php-fpm Up 9000/tcp
|
|||||||
laradock_volumes_data_1 true Exit 0
|
laradock_volumes_data_1 true Exit 0
|
||||||
laradock_volumes_source_1 true Exit 0
|
laradock_volumes_source_1 true Exit 0
|
||||||
laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222->22/tcp
|
laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222->22/tcp
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
<a name="enablePhpXdebug"></a>
|
<a name="enablePhpXdebug"></a>
|
||||||
## Enable xDebug on php-fpm
|
## Enable xDebug on php-fpm
|
||||||
|
|
||||||
In a host terminal sitting in the laradock folder, run: `.php-fpm/xdebug status`
|
In a host terminal sitting in the laradock folder, run: `.php-fpm/xdebug status`
|
||||||
You should see something like the following:
|
You should see something like the following:
|
||||||
|
|
||||||
```
|
```
|
||||||
xDebug status
|
xDebug status
|
||||||
laradock_php-fpm_1
|
laradock_php-fpm_1
|
||||||
@@ -422,6 +428,7 @@ Copyright (c) 1997-2016 The PHP Group
|
|||||||
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
|
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
|
||||||
with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans
|
with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans
|
||||||
```
|
```
|
||||||
|
|
||||||
Other commands include `.php-fpm/xdebug start | stop`.
|
Other commands include `.php-fpm/xdebug start | stop`.
|
||||||
|
|
||||||
If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will already be running when
|
If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will already be running when
|
||||||
@@ -430,6 +437,7 @@ If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will
|
|||||||
|
|
||||||
<a name="InstallPHPStormConfigs"></a>
|
<a name="InstallPHPStormConfigs"></a>
|
||||||
## PHPStorm Settings
|
## PHPStorm Settings
|
||||||
|
|
||||||
- Here are some settings that are known to work:
|
- Here are some settings that are known to work:
|
||||||
- `Settings/BuildDeploymentConnection`
|
- `Settings/BuildDeploymentConnection`
|
||||||
- 
|
- 
|
||||||
|
|||||||
@@ -2,15 +2,16 @@ FROM webdevops/apache:ubuntu-16.04
|
|||||||
|
|
||||||
MAINTAINER Eric Pfeiffer <computerfr33k@users.noreply.github.com>
|
MAINTAINER Eric Pfeiffer <computerfr33k@users.noreply.github.com>
|
||||||
|
|
||||||
ARG PHP_SOCKET=php-fpm:9000
|
ARG PHP_UPSTREAM_CONTAINER=php-fpm
|
||||||
|
ARG PHP_UPSTREAM_PORT=9000
|
||||||
|
|
||||||
ENV WEB_PHP_SOCKET=$PHP_SOCKET
|
ENV WEB_PHP_SOCKET=${PHP_UPSTREAM_CONTAINER}:${PHP_UPSTREAM_PORT}
|
||||||
|
|
||||||
ENV WEB_DOCUMENT_ROOT=/var/www/public/
|
ENV WEB_DOCUMENT_ROOT=/var/www/
|
||||||
|
|
||||||
EXPOSE 80 443
|
EXPOSE 80 443
|
||||||
|
|
||||||
WORKDIR /var/www/public/
|
WORKDIR /var/www/
|
||||||
|
|
||||||
COPY vhost.conf /etc/apache2/sites-enabled/vhost.conf
|
COPY vhost.conf /etc/apache2/sites-enabled/vhost.conf
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<VirtualHost *:80>
|
<VirtualHost *:80>
|
||||||
ServerName laradock.dev
|
ServerName laradock.dev
|
||||||
DocumentRoot /var/www/public/
|
DocumentRoot /var/www/
|
||||||
Options Indexes FollowSymLinks
|
Options Indexes FollowSymLinks
|
||||||
|
|
||||||
<Directory "/var/www/public/">
|
<Directory "/var/www/">
|
||||||
AllowOverride All
|
AllowOverride All
|
||||||
<IfVersion < 2.4>
|
<IfVersion < 2.4>
|
||||||
Allow from all
|
Allow from all
|
||||||
|
|||||||
@@ -1,28 +1,30 @@
|
|||||||
# Docs: https://caddyserver.com/docs/caddyfile
|
# Docs: https://caddyserver.com/docs/caddyfile
|
||||||
0.0.0.0:80
|
0.0.0.0:80 {
|
||||||
root /var/www/public
|
root /var/www/public
|
||||||
fastcgi / php-fpm:9000 php {
|
fastcgi / php-fpm:9000 php {
|
||||||
index index.php
|
index index.php
|
||||||
|
}
|
||||||
|
|
||||||
|
# To handle .html extensions with laravel change ext to
|
||||||
|
# ext / .html
|
||||||
|
|
||||||
|
rewrite {
|
||||||
|
to {path} {path}/ /index.php?{query}
|
||||||
|
}
|
||||||
|
gzip
|
||||||
|
browse
|
||||||
|
log /var/log/caddy/access.log
|
||||||
|
errors /var/log/caddy/error.log
|
||||||
|
# Uncomment to enable TLS (HTTPS)
|
||||||
|
# Change the first list to listen on port 443 when enabling TLS
|
||||||
|
#tls self_signed
|
||||||
|
|
||||||
|
# To use Lets encrpt tls with a DNS provider uncomment these
|
||||||
|
# lines and change the provider as required
|
||||||
|
#tls {
|
||||||
|
# dns cloudflare
|
||||||
|
#}
|
||||||
}
|
}
|
||||||
|
laradock.demo {
|
||||||
# To handle .html extensions with laravel change ext to
|
root /var/www/public
|
||||||
# ext / .html
|
|
||||||
|
|
||||||
rewrite {
|
|
||||||
r .*
|
|
||||||
ext /
|
|
||||||
to /index.php?{query}
|
|
||||||
}
|
}
|
||||||
gzip
|
|
||||||
browse
|
|
||||||
log /var/log/caddy/access.log
|
|
||||||
errors /var/log/caddy/error.log
|
|
||||||
# Uncomment to enable TLS (HTTPS)
|
|
||||||
# Change the first list to listen on port 443 when enabling TLS
|
|
||||||
#tls self_signed
|
|
||||||
|
|
||||||
# To use Lets encrpt tls with a DNS provider uncomment these
|
|
||||||
# lines and change the provider as required
|
|
||||||
#tls {
|
|
||||||
# dns cloudflare
|
|
||||||
#}
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
FROM alpine:3.4
|
FROM alpine:3.5
|
||||||
|
|
||||||
MAINTAINER Eric Pfeiffer <computerfr33k@users.noreply.github.com>
|
MAINTAINER Eric Pfeiffer <computerfr33k@users.noreply.github.com>
|
||||||
|
|
||||||
ENV caddy_version=0.10.3
|
ENV caddy_version=0.10.5
|
||||||
ARG plugins=http.git
|
ARG plugins=http.git
|
||||||
|
|
||||||
LABEL caddy_version="$caddy_version" architecture="amd64"
|
LABEL caddy_version="$caddy_version" architecture="amd64"
|
||||||
|
|
||||||
RUN apk update \
|
RUN apk update \
|
||||||
&& apk upgrade \
|
&& apk upgrade \
|
||||||
&& apk add tar curl git openssh
|
&& apk add --no-cache openssh-client git tar curl
|
||||||
|
|
||||||
RUN curl --silent --show-error --fail --location \
|
RUN curl --silent --show-error --fail --location \
|
||||||
--header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \
|
--header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ services:
|
|||||||
- INSTALL_DEPLOYER=${WORKSPACE_INSTALL_DEPLOYER}
|
- INSTALL_DEPLOYER=${WORKSPACE_INSTALL_DEPLOYER}
|
||||||
- INSTALL_LINUXBREW=${WORKSPACE_INSTALL_LINUXBREW}
|
- INSTALL_LINUXBREW=${WORKSPACE_INSTALL_LINUXBREW}
|
||||||
- INSTALL_MC=${WORKSPACE_INSTALL_MC}
|
- INSTALL_MC=${WORKSPACE_INSTALL_MC}
|
||||||
|
- INSTALL_SYMFONY=${WORKSPACE_INSTALL_SYMFONY}
|
||||||
|
- INSTALL_PYTHON=${WORKSPACE_INSTALL_PYTHON}
|
||||||
- INSTALL_IMAGE_OPTIMIZERS=${WORKSPACE_INSTALL_IMAGE_OPTIMIZERS}
|
- INSTALL_IMAGE_OPTIMIZERS=${WORKSPACE_INSTALL_IMAGE_OPTIMIZERS}
|
||||||
- PUID=${WORKSPACE_PUID}
|
- PUID=${WORKSPACE_PUID}
|
||||||
- PGID=${WORKSPACE_PGID}
|
- PGID=${WORKSPACE_PGID}
|
||||||
@@ -107,13 +109,14 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- backend
|
- backend
|
||||||
|
|
||||||
### Nginx Server Container ##################################
|
### NGINX Server Container ##################################
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
build:
|
build:
|
||||||
context: ./nginx
|
context: ./nginx
|
||||||
args:
|
args:
|
||||||
- PHP_UPSTREAM=php-fpm
|
- PHP_UPSTREAM_CONTAINER=${NGINX_PHP_UPSTREAM_CONTAINER}
|
||||||
|
- PHP_UPSTREAM_PORT=${NGINX_PHP_UPSTREAM_PORT}
|
||||||
volumes_from:
|
volumes_from:
|
||||||
- applications
|
- applications
|
||||||
volumes:
|
volumes:
|
||||||
@@ -146,7 +149,8 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: ./apache2
|
context: ./apache2
|
||||||
args:
|
args:
|
||||||
- PHP_SOCKET=${PHP_SOCKET}
|
- PHP_UPSTREAM_CONTAINER=${APACHE_PHP_UPSTREAM_CONTAINER}
|
||||||
|
- PHP_UPSTREAM_PORT=${APACHE_PHP_UPSTREAM_PORT}
|
||||||
volumes_from:
|
volumes_from:
|
||||||
- applications
|
- applications
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ WORKSPACE_INSTALL_LARAVEL_INSTALLER=false
|
|||||||
WORKSPACE_INSTALL_DEPLOYER=false
|
WORKSPACE_INSTALL_DEPLOYER=false
|
||||||
WORKSPACE_INSTALL_LINUXBREW=false
|
WORKSPACE_INSTALL_LINUXBREW=false
|
||||||
WORKSPACE_INSTALL_MC=false
|
WORKSPACE_INSTALL_MC=false
|
||||||
|
WORKSPACE_INSTALL_SYMFONY=false
|
||||||
|
WORKSPACE_INSTALL_PYTHON=false
|
||||||
WORKSPACE_INSTALL_IMAGE_OPTIMIZERS=false
|
WORKSPACE_INSTALL_IMAGE_OPTIMIZERS=false
|
||||||
WORKSPACE_PUID=1000
|
WORKSPACE_PUID=1000
|
||||||
WORKSPACE_PGID=1000
|
WORKSPACE_PGID=1000
|
||||||
@@ -80,15 +82,17 @@ NGINX_HOST_HTTP_PORT=80
|
|||||||
NGINX_HOST_HTTPS_PORT=443
|
NGINX_HOST_HTTPS_PORT=443
|
||||||
NGINX_HOST_LOG_PATH=./logs/nginx/
|
NGINX_HOST_LOG_PATH=./logs/nginx/
|
||||||
NGINX_SITES_PATH=./nginx/sites/
|
NGINX_SITES_PATH=./nginx/sites/
|
||||||
|
NGINX_PHP_UPSTREAM_CONTAINER=php-fpm
|
||||||
|
NGINX_PHP_UPSTREAM_PORT=9000
|
||||||
|
|
||||||
### APACHE #############################################################################################################
|
### APACHE #############################################################################################################
|
||||||
|
|
||||||
APACHE_HOST_HTTP_PORT=80
|
APACHE_HOST_HTTP_PORT=80
|
||||||
APACHE_HOST_HTTPS_PORT=443
|
APACHE_HOST_HTTPS_PORT=443
|
||||||
APACHE2_PHP_SOCKET=php-fpm:9000
|
|
||||||
APACHE_HOST_LOG_PATH=./logs/apache2
|
APACHE_HOST_LOG_PATH=./logs/apache2
|
||||||
APACHE_SITES_PATH=./apache2/sites
|
APACHE_SITES_PATH=./apache2/sites
|
||||||
PHP_SOCKET=php-fpm:9000
|
APACHE_PHP_UPSTREAM_CONTAINER=php-fpm
|
||||||
|
APACHE_PHP_UPSTREAM_PORT=9000
|
||||||
|
|
||||||
### MYSQL ##############################################################################################################
|
### MYSQL ##############################################################################################################
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
|||||||
|
|
||||||
ADD nginx.conf /etc/nginx/
|
ADD nginx.conf /etc/nginx/
|
||||||
|
|
||||||
ARG PHP_UPSTREAM=php-fpm
|
ARG PHP_UPSTREAM_CONTAINER=php-fpm
|
||||||
|
ARG PHP_UPSTREAM_PORT=9000
|
||||||
|
|
||||||
# fix a problem--#397, change application source from dl-cdn.alpinelinux.org to aliyun source.
|
# fix a problem--#397, change application source from dl-cdn.alpinelinux.org to aliyun source.
|
||||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories
|
||||||
@@ -12,9 +13,11 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories
|
|||||||
RUN apk update \
|
RUN apk update \
|
||||||
&& apk upgrade \
|
&& apk upgrade \
|
||||||
&& apk add --no-cache bash \
|
&& apk add --no-cache bash \
|
||||||
&& adduser -D -H -u 1000 -s /bin/bash www-data \
|
&& adduser -D -H -u 1000 -s /bin/bash www-data
|
||||||
&& rm /etc/nginx/conf.d/default.conf \
|
|
||||||
&& echo "upstream php-upstream { server ${PHP_UPSTREAM}:9000; }" > /etc/nginx/conf.d/upstream.conf
|
# Set upstream conf and remove the default conf
|
||||||
|
RUN echo "upstream php-upstream { server ${PHP_UPSTREAM_CONTAINER}:${PHP_UPSTREAM_PORT}; }" > /etc/nginx/conf.d/upstream.conf \
|
||||||
|
&& rm /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
CMD ["nginx"]
|
CMD ["nginx"]
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ server {
|
|||||||
listen 80;
|
listen 80;
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
|
|
||||||
server_name project-1.dev;
|
server_name app.dev;
|
||||||
root /var/www/project-1/public;
|
root /var/www/app;
|
||||||
index index.php index.html index.htm;
|
index index.php index.html index.htm;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
@@ -29,4 +29,7 @@ server {
|
|||||||
root /var/www/letsencrypt/;
|
root /var/www/letsencrypt/;
|
||||||
log_not_found off;
|
log_not_found off;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
error_log /var/log/nginx/app_error.log;
|
||||||
|
access_log /var/log/nginx/app_access.log;
|
||||||
}
|
}
|
||||||
@@ -3,8 +3,8 @@ server {
|
|||||||
listen 80;
|
listen 80;
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
|
|
||||||
server_name project-2.dev;
|
server_name laravel.dev;
|
||||||
root /var/www/project-2/public;
|
root /var/www/laravel/public;
|
||||||
index index.php index.html index.htm;
|
index index.php index.html index.htm;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
@@ -29,4 +29,7 @@ server {
|
|||||||
root /var/www/letsencrypt/;
|
root /var/www/letsencrypt/;
|
||||||
log_not_found off;
|
log_not_found off;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
error_log /var/log/nginx/laravel_error.log;
|
||||||
|
access_log /var/log/nginx/laravel_access.log;
|
||||||
}
|
}
|
||||||
28
nginx/sites/symfony.conf.example
Normal file
28
nginx/sites/symfony.conf.example
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
server {
|
||||||
|
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
|
||||||
|
server_name symfony.dev;
|
||||||
|
root /var/www/projects/symfony/web;
|
||||||
|
index index.php index.html index.htm;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri @rewriteapp;
|
||||||
|
}
|
||||||
|
|
||||||
|
location @rewriteapp {
|
||||||
|
rewrite ^(.*)$ /app.php/$1 last;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^/(app|app_dev|config)\.php(/|$) {
|
||||||
|
fastcgi_pass php-upstream;
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param HTTPS off;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_log /var/log/nginx/symfony_error.log;
|
||||||
|
access_log /var/log/nginx/symfony_access.log;
|
||||||
|
}
|
||||||
@@ -37,5 +37,4 @@ COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
|||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
|
||||||
RUN rm -r /var/lib/apt/lists/*
|
|
||||||
WORKDIR /etc/supervisor/conf.d/
|
WORKDIR /etc/supervisor/conf.d/
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ if [ -n "${HUGO_VERSION}" ]; then
|
|||||||
|
|
||||||
# Download hugo binary
|
# Download hugo binary
|
||||||
curl -L https://github.com/spf13/hugo/releases/download/v$HUGO_VERSION/$HUGO_PACKAGE.tar.gz | tar xz
|
curl -L https://github.com/spf13/hugo/releases/download/v$HUGO_VERSION/$HUGO_PACKAGE.tar.gz | tar xz
|
||||||
mkdir $HOME/bin
|
mkdir -p $HOME/bin
|
||||||
mv ./${HUGO_BIN}/${HUGO_BIN} $HOME/bin/hugo
|
mv ./${HUGO_BIN}/${HUGO_BIN} $HOME/bin/hugo
|
||||||
|
|
||||||
# Remove existing docs
|
# Remove existing docs
|
||||||
|
|||||||
@@ -202,6 +202,8 @@ ENV DRUSH_VERSION 8.1.2
|
|||||||
ARG INSTALL_DRUSH=false
|
ARG INSTALL_DRUSH=false
|
||||||
ENV INSTALL_DRUSH ${INSTALL_DRUSH}
|
ENV INSTALL_DRUSH ${INSTALL_DRUSH}
|
||||||
RUN if [ ${INSTALL_DRUSH} = true ]; then \
|
RUN if [ ${INSTALL_DRUSH} = true ]; then \
|
||||||
|
apt-get update -yqq && \
|
||||||
|
apt-get -y install mysql-client && \
|
||||||
# Install Drush 8 with the phar file.
|
# Install Drush 8 with the phar file.
|
||||||
curl -fsSL -o /usr/local/bin/drush https://github.com/drush-ops/drush/releases/download/$DRUSH_VERSION/drush.phar | bash && \
|
curl -fsSL -o /usr/local/bin/drush https://github.com/drush-ops/drush/releases/download/$DRUSH_VERSION/drush.phar | bash && \
|
||||||
chmod +x /usr/local/bin/drush && \
|
chmod +x /usr/local/bin/drush && \
|
||||||
@@ -317,14 +319,6 @@ USER laradock
|
|||||||
RUN echo "" >> ~/.bashrc && \
|
RUN echo "" >> ~/.bashrc && \
|
||||||
echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc
|
echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc
|
||||||
|
|
||||||
#####################################
|
|
||||||
# Laravel Artisan Alias
|
|
||||||
#####################################
|
|
||||||
USER root
|
|
||||||
|
|
||||||
RUN echo "" >> ~/.bashrc && \
|
|
||||||
echo 'alias art="php artisan"' >> ~/.bashrc
|
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
# Laravel Envoy:
|
# Laravel Envoy:
|
||||||
#####################################
|
#####################################
|
||||||
@@ -440,6 +434,41 @@ RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \
|
|||||||
|
|
||||||
USER laradock
|
USER laradock
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Symfony:
|
||||||
|
#####################################
|
||||||
|
USER root
|
||||||
|
ARG INSTALL_SYMFONY=false
|
||||||
|
ENV INSTALL_SYMFONY ${INSTALL_SYMFONY}
|
||||||
|
RUN if [ ${INSTALL_SYMFONY} = true ]; then \
|
||||||
|
|
||||||
|
mkdir -p /usr/local/bin \
|
||||||
|
&& curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony \
|
||||||
|
&& chmod a+x /usr/local/bin/symfony \
|
||||||
|
|
||||||
|
# Symfony 3 alias
|
||||||
|
&& echo 'alias dev="php bin/console -e=dev"' >> ~/.bashrc \
|
||||||
|
&& echo 'alias prod="php bin/console -e=prod"' >> ~/.bashrc \
|
||||||
|
|
||||||
|
# Symfony 2 alias
|
||||||
|
# && echo 'alias dev="php app/console -e=dev"' >> ~/.bashrc \
|
||||||
|
# && echo 'alias prod="php app/console -e=prod"' >> ~/.bashrc \
|
||||||
|
|
||||||
|
;fi
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# PYTHON:
|
||||||
|
#####################################
|
||||||
|
|
||||||
|
ARG INSTALL_PYTHON=false
|
||||||
|
ENV INSTALL_PYTHON ${INSTALL_PYTHON}
|
||||||
|
RUN if [ ${INSTALL_PYTHON} = true ]; then \
|
||||||
|
apt-get update \
|
||||||
|
&& apt-get -y install python python-pip python-dev build-essential \
|
||||||
|
&& pip install --upgrade pip \
|
||||||
|
&& pip install --upgrade virtualenv \
|
||||||
|
;fi
|
||||||
|
|
||||||
#
|
#
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# Final Touch
|
# Final Touch
|
||||||
|
|||||||
@@ -202,6 +202,8 @@ ENV DRUSH_VERSION 8.1.2
|
|||||||
ARG INSTALL_DRUSH=false
|
ARG INSTALL_DRUSH=false
|
||||||
ENV INSTALL_DRUSH ${INSTALL_DRUSH}
|
ENV INSTALL_DRUSH ${INSTALL_DRUSH}
|
||||||
RUN if [ ${INSTALL_DRUSH} = true ]; then \
|
RUN if [ ${INSTALL_DRUSH} = true ]; then \
|
||||||
|
apt-get update -yqq && \
|
||||||
|
apt-get -y install mysql-client && \
|
||||||
# Install Drush 8 with the phar file.
|
# Install Drush 8 with the phar file.
|
||||||
curl -fsSL -o /usr/local/bin/drush https://github.com/drush-ops/drush/releases/download/$DRUSH_VERSION/drush.phar | bash && \
|
curl -fsSL -o /usr/local/bin/drush https://github.com/drush-ops/drush/releases/download/$DRUSH_VERSION/drush.phar | bash && \
|
||||||
chmod +x /usr/local/bin/drush && \
|
chmod +x /usr/local/bin/drush && \
|
||||||
@@ -334,14 +336,6 @@ USER laradock
|
|||||||
RUN echo "" >> ~/.bashrc && \
|
RUN echo "" >> ~/.bashrc && \
|
||||||
echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc
|
echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc
|
||||||
|
|
||||||
#####################################
|
|
||||||
# Laravel Artisan Alias
|
|
||||||
#####################################
|
|
||||||
USER root
|
|
||||||
|
|
||||||
RUN echo "" >> ~/.bashrc && \
|
|
||||||
echo 'alias art="php artisan"' >> ~/.bashrc
|
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
# Laravel Envoy:
|
# Laravel Envoy:
|
||||||
#####################################
|
#####################################
|
||||||
@@ -508,6 +502,19 @@ RUN if [ ${INSTALL_MC} = true ]; then\
|
|||||||
chmod +x /usr/local/bin/mc \
|
chmod +x /usr/local/bin/mc \
|
||||||
;fi
|
;fi
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Image optimizers:
|
||||||
|
#####################################
|
||||||
|
USER root
|
||||||
|
ARG INSTALL_IMAGE_OPTIMIZERS=false
|
||||||
|
ENV INSTALL_IMAGE_OPTIMIZERS ${INSTALL_IMAGE_OPTIMIZERS}
|
||||||
|
RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \
|
||||||
|
apt-get install -y --force-yes jpegoptim optipng pngquant gifsicle && \
|
||||||
|
if [ ${INSTALL_NODE} = true ]; then \
|
||||||
|
. ~/.bashrc && npm install -g svgo \
|
||||||
|
;fi\
|
||||||
|
;fi
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
# Symfony:
|
# Symfony:
|
||||||
#####################################
|
#####################################
|
||||||
@@ -531,16 +538,16 @@ RUN if [ ${INSTALL_SYMFONY} = true ]; then \
|
|||||||
;fi
|
;fi
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
# Image optimizers:
|
# PYTHON:
|
||||||
#####################################
|
#####################################
|
||||||
USER root
|
|
||||||
ARG INSTALL_IMAGE_OPTIMIZERS=false
|
ARG INSTALL_PYTHON=false
|
||||||
ENV INSTALL_IMAGE_OPTIMIZERS ${INSTALL_IMAGE_OPTIMIZERS}
|
ENV INSTALL_PYTHON ${INSTALL_PYTHON}
|
||||||
RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \
|
RUN if [ ${INSTALL_PYTHON} = true ]; then \
|
||||||
apt-get install -y --force-yes jpegoptim optipng pngquant gifsicle && \
|
apt-get update \
|
||||||
if [ ${INSTALL_NODE} = true ]; then \
|
&& apt-get -y install python python-pip python-dev build-essential \
|
||||||
. ~/.bashrc && npm install -g svgo \
|
&& pip install --upgrade pip \
|
||||||
;fi\
|
&& pip install --upgrade virtualenv \
|
||||||
;fi
|
;fi
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -199,6 +199,8 @@ ENV DRUSH_VERSION 8.1.2
|
|||||||
ARG INSTALL_DRUSH=false
|
ARG INSTALL_DRUSH=false
|
||||||
ENV INSTALL_DRUSH ${INSTALL_DRUSH}
|
ENV INSTALL_DRUSH ${INSTALL_DRUSH}
|
||||||
RUN if [ ${INSTALL_DRUSH} = true ]; then \
|
RUN if [ ${INSTALL_DRUSH} = true ]; then \
|
||||||
|
apt-get update -yqq && \
|
||||||
|
apt-get -y install mysql-client && \
|
||||||
# Install Drush 8 with the phar file.
|
# Install Drush 8 with the phar file.
|
||||||
curl -fsSL -o /usr/local/bin/drush https://github.com/drush-ops/drush/releases/download/$DRUSH_VERSION/drush.phar | bash && \
|
curl -fsSL -o /usr/local/bin/drush https://github.com/drush-ops/drush/releases/download/$DRUSH_VERSION/drush.phar | bash && \
|
||||||
chmod +x /usr/local/bin/drush && \
|
chmod +x /usr/local/bin/drush && \
|
||||||
@@ -335,14 +337,6 @@ USER laradock
|
|||||||
RUN echo "" >> ~/.bashrc && \
|
RUN echo "" >> ~/.bashrc && \
|
||||||
echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc
|
echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc
|
||||||
|
|
||||||
#####################################
|
|
||||||
# Laravel Artisan Alias
|
|
||||||
#####################################
|
|
||||||
USER root
|
|
||||||
|
|
||||||
RUN echo "" >> ~/.bashrc && \
|
|
||||||
echo 'alias art="php artisan"' >> ~/.bashrc
|
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
# Laravel Envoy:
|
# Laravel Envoy:
|
||||||
#####################################
|
#####################################
|
||||||
@@ -511,6 +505,21 @@ RUN if [ ${INSTALL_MC} = true ]; then\
|
|||||||
chmod +x /usr/local/bin/mc \
|
chmod +x /usr/local/bin/mc \
|
||||||
;fi
|
;fi
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Image optimizers:
|
||||||
|
#####################################
|
||||||
|
USER root
|
||||||
|
ARG INSTALL_IMAGE_OPTIMIZERS=false
|
||||||
|
ENV INSTALL_IMAGE_OPTIMIZERS ${INSTALL_IMAGE_OPTIMIZERS}
|
||||||
|
RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \
|
||||||
|
apt-get install -y --force-yes jpegoptim optipng pngquant gifsicle && \
|
||||||
|
if [ ${INSTALL_NODE} = true ]; then \
|
||||||
|
. ~/.bashrc && npm install -g svgo \
|
||||||
|
;fi\
|
||||||
|
;fi
|
||||||
|
|
||||||
|
USER laradock
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
# Symfony:
|
# Symfony:
|
||||||
#####################################
|
#####################################
|
||||||
@@ -534,19 +543,18 @@ RUN if [ ${INSTALL_SYMFONY} = true ]; then \
|
|||||||
;fi
|
;fi
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
# Image optimizers:
|
# PYTHON:
|
||||||
#####################################
|
#####################################
|
||||||
USER root
|
|
||||||
ARG INSTALL_IMAGE_OPTIMIZERS=false
|
ARG INSTALL_PYTHON=false
|
||||||
ENV INSTALL_IMAGE_OPTIMIZERS ${INSTALL_IMAGE_OPTIMIZERS}
|
ENV INSTALL_PYTHON ${INSTALL_PYTHON}
|
||||||
RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \
|
RUN if [ ${INSTALL_PYTHON} = true ]; then \
|
||||||
apt-get install -y --force-yes jpegoptim optipng pngquant gifsicle && \
|
apt-get update \
|
||||||
if [ ${INSTALL_NODE} = true ]; then \
|
&& apt-get -y install python python-pip python-dev build-essential \
|
||||||
. ~/.bashrc && npm install -g svgo \
|
&& pip install --upgrade pip \
|
||||||
;fi\
|
&& pip install --upgrade virtualenv \
|
||||||
;fi
|
;fi
|
||||||
|
|
||||||
USER laradock
|
|
||||||
|
|
||||||
#
|
#
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -10,23 +10,54 @@ COL_BLUE=$ESC_SEQ"34;01m"
|
|||||||
COL_MAGENTA=$ESC_SEQ"35;01m"
|
COL_MAGENTA=$ESC_SEQ"35;01m"
|
||||||
COL_CYAN=$ESC_SEQ"36;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
|
# Commonly Used Aliases
|
||||||
alias ..="cd .."
|
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 c="clear"
|
||||||
alias cla="clear && ls -l"
|
alias cla="clear && ls -l"
|
||||||
alias cll="clear && ls -la"
|
alias cll="clear && ls -la"
|
||||||
alias cls="clear && ls"
|
alias cls="clear && ls"
|
||||||
alias code="cd /var/www"
|
alias code="cd /var/www"
|
||||||
alias ea="vi ~/aliases"
|
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
|
# 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 art="php artisan"
|
||||||
alias artisan="php artisan"
|
alias artisan="php artisan"
|
||||||
alias cdump="composer dump-autoload -o"
|
alias cdump="composer dump-autoload -o"
|
||||||
@@ -34,18 +65,31 @@ alias composer:dump="composer dump-autoload -o"
|
|||||||
alias db:reset="php artisan migrate:reset && php artisan migrate --seed"
|
alias db:reset="php artisan migrate:reset && php artisan migrate --seed"
|
||||||
alias migrate="php artisan migrate"
|
alias migrate="php artisan migrate"
|
||||||
alias seed="php artisan:seed"
|
alias seed="php artisan:seed"
|
||||||
alias phpunit="./vendor/bin/phpunit"
|
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
# requires installation of 'https://www.npmjs.com/package/npms-cli'
|
# requires installation of 'https://www.npmjs.com/package/npms-cli'
|
||||||
alias npms="npms search"
|
alias npms="npms search"
|
||||||
|
|
||||||
# requires installation of 'https://www.npmjs.com/package/package-menu-cli'
|
# requires installation of 'https://www.npmjs.com/package/package-menu-cli'
|
||||||
alias pm="package-menu"
|
alias pm="package-menu"
|
||||||
|
|
||||||
# requires installation of 'https://www.npmjs.com/package/pkg-version-cli'
|
# requires installation of 'https://www.npmjs.com/package/pkg-version-cli'
|
||||||
alias pv="package-version"
|
alias pv="package-version"
|
||||||
|
|
||||||
# requires installation of 'https://github.com/sindresorhus/latest-version-cli'
|
# requires installation of 'https://github.com/sindresorhus/latest-version-cli'
|
||||||
alias lv="latest-version"
|
alias lv="latest-version"
|
||||||
|
|
||||||
@@ -56,7 +100,6 @@ alias git-revert="git reset --hard && git clean -df"
|
|||||||
alias gs="git status"
|
alias gs="git status"
|
||||||
alias whoops="git reset --hard && git clean -df"
|
alias whoops="git reset --hard && git clean -df"
|
||||||
|
|
||||||
|
|
||||||
# Create a new directory and enter it
|
# Create a new directory and enter it
|
||||||
function mkd() {
|
function mkd() {
|
||||||
mkdir -p "$@" && cd "$@"
|
mkdir -p "$@" && cd "$@"
|
||||||
@@ -69,3 +112,25 @@ function md() {
|
|||||||
function xtree {
|
function xtree {
|
||||||
find ${1:-.} -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
|
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;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user