forked from fsouza/docker-ssl-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
44 lines (39 loc) · 776 Bytes
/
run.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
#!/bin/sh
targetDocker="bixel"
port=443
targetPort=80
while getopts ':d::p::t:' opt; do
case "$opt" in
d)
targetDocker=$OPTARG
;;
p)
port=$OPTARG
;;
t)
targetPort=$OPTARG
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
*)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
esac
done
proxyname="${targetDocker}_proxy"
echo === Environment ===
echo Bixel App: ${targetDocker}
echo Proxy App Name: ${proxyname}
echo SSL Port: ${port}
echo
echo === Running SSL-Proxy Image... ===
docker rm -f ${proxyname}
docker run -d -p ${port}:${port} \
--name="${proxyname}" \
--link ${targetDocker}:proxyapp \
--env PORT=${port} \
--env TARGET_PORT=${targetPort} \
${proxyname}