forked from yeszao/dnmp
-
Notifications
You must be signed in to change notification settings - Fork 4
/
bash.alias
127 lines (119 loc) · 2.65 KB
/
bash.alias
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# 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 \
--network dnmp_net-default \
--interactive \
--rm \
--volume $PWD:/www:rw \
--workdir /www \
dnmp_php php "$@"
}
# php5.6 cli
php56 () {
tty=
tty -s && tty=--tty
docker run \
$tty \
--network dnmp_net-default \
--interactive \
--rm \
--volume $PWD:/www:rw \
--workdir /www \
dnmp_php56 php "$@"
}
# php5.4 cli
php54 () {
tty=
tty -s && tty=--tty
docker run \
$tty \
--network dnmp_net-default \
--interactive \
--rm \
--volume $PWD:/www:rw \
--workdir /www \
dnmp_php54 php "$@"
}
# php7 composer
composer () {
tty=
tty -s && tty=--tty
docker run \
$tty \
--network dnmp_net-default \
--interactive \
--rm \
--user www-data:www-data \
--volume ~/Development/Docker/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 \
--network dnmp_net-default \
--interactive \
--rm \
--user www-data:www-data \
--volume ~/Development/Docker/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 \
--network dnmp_net-default \
--interactive \
--rm \
--user www-data:www-data \
--volume ~/Development/Docker/dnmp/data/composer:/tmp/composer \
--volume $(pwd):/app \
--workdir /app \
dnmp_php54 composer "$@"
}
# python cli
python () {
tty=
tty -s && tty=--tty
docker run \
$tty \
--network dnmp_net-default \
--interactive \
--rm \
--volume $PWD:/code:rw \
--workdir /code \
dnmp_python python "$@"
}
# golang cli
go () {
tty=
tty -s && tty=--tty
docker run \
$tty \
--network dnmp_net-default \
--interactive \
--rm \
--volume $PWD:/app:rw \
--workdir /app \
--env GOOS=linux \
--env GOARCH=amd64 \
dnmp_golang go "$@"
}