-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.override.sh
114 lines (92 loc) · 1.33 KB
/
docker-compose.override.sh
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
#!/bin/bash
CONTENT=$(cat <<EOF
version: '3.7'
services:
EOF
)
NGINX=$(cat <<EOF
nginx:
ports:
- "80:80"
- "443:443"
EOF
)
MARIADB=$(cat <<EOF
mariadb:
ports:
- "3306:3306"
EOF
)
POSTGRES=$(cat <<EOF
postgres:
environment:
REPLICATION: 'true'
WAL_LEVEL: 'logical'
ports:
- 5432:5432
EOF
)
ADMINER=$(cat <<EOF
adminer:
ports:
- "8080:8080"
EOF
)
MONGO=$(cat <<EOF
mongo:
ports:
- 27017:27017
EOF
)
MONGO_EXPRESS=$(cat <<EOF
mongo-express:
ports:
- 8081:8081
EOF
)
REDIS=$(cat <<EOF
redis:
ports:
- 6379:6379
EOF
)
ELASTICSEARCH=$(cat <<EOF
elasticsearch:
ports:
- 9200:9200
EOF
)
for var in "$@"
do
if [ $var = 'nginx' ]
then
CONTENT+=$NGINX
elif [ $var = 'mariadb' ]
then
CONTENT+=$MARIADB
elif [ $var = 'postgres' ]
then
CONTENT+=$POSTGRES
elif [ $var = 'adminer' ]
then
CONTENT+=$ADMINER
elif [ $var = 'mongo' ]
then
CONTENT+=$MONGO
elif [ $var = 'mongo-express' ]
then
CONTENT+=$MONGO_EXPRESS
elif [ $var = 'redis' ]
then
CONTENT+=$REDIS
elif [ $var = 'elasticsearch' ]
then
CONTENT+=$ELASTICSEARCH
fi
done
cat <<EOF > docker-compose.override.yml
$CONTENT
EOF
cat <<EOF > example.docker-compose.override.yml
$CONTENT
EOF