forked from yeszao/dnmp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash.alias.sample
91 lines (85 loc) · 1.83 KB
/
bash.alias.sample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# dnmp alias
alias dnginx='docker exec -it nginx /bin/sh'
alias dphp='docker exec -it php /bin/sh'
alias dphp56='docker exec -it php56 /bin/sh'
alias dphp54='docker exec -it php54 /bin/sh'
alias dmysql='docker exec -it mysql /bin/bash'
alias dredis='docker exec -it redis /bin/sh'
# php7 cli
php () {
tty=
tty -s && tty=--tty
docker run \
$tty \
--interactive \
--rm \
--volume $PWD:/www:rw \
--workdir /www \
dnmp_php php "$@"
}
# php5.6 cli
php56 () {
tty=
tty -s && tty=--tty
docker run \
$tty \
--interactive \
--rm \
--volume $PWD:/www:rw \
--workdir /www \
dnmp_php56 php "$@"
}
# php5.4 cli
php54 () {
tty=
tty -s && tty=--tty
docker run \
$tty \
--interactive \
--rm \
--volume $PWD:/www:rw \
--workdir /www \
dnmp_php54 php "$@"
}
# php7 composer
composer () {
tty=
tty -s && tty=--tty
docker run \
$tty \
--interactive \
--rm \
--user www-data:www-data \
--volume ~/dnmp/data/composer:/tmp/composer \
--volume $(pwd):/app \
--workdir /app \
dnmp_php composer "$@"
}
# php5.6 composer
composer56 () {
tty=
tty -s && tty=--tty
docker run \
$tty \
--interactive \
--rm \
--user www-data:www-data \
--volume ~/dnmp/data/composer:/tmp/composer \
--volume $(pwd):/app \
--workdir /app \
dnmp_php56 composer "$@"
}
# php5.4 composer
composer54 () {
tty=
tty -s && tty=--tty
docker run \
$tty \
--interactive \
--rm \
--user www-data:www-data \
--volume ~/dnmp/data/composer:/tmp/composer \
--volume $(pwd):/app \
--workdir /app \
dnmp_php54 composer "$@"
}