forked from AnyBucket-Lab/circleci-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-entrypoint.sh
executable file
·72 lines (60 loc) · 1.59 KB
/
docker-entrypoint.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
#!/bin/bash
set -ex
if [[ "$1" = 'start' ]]
then
# Generate Cert if none is present
if [[ ! -s /etc/ssl/private/star.circlehost.key ]]
then
mkdir -p /etc/ssl/private
openssl req -batch -new \
-x509 -newkey rsa:2048 -sha256 -nodes -days 365 \
-subj '/C=US/ST=California/L=San Francisco/O=CircleCI/CN=*.circlehost' \
-keyout /etc/ssl/private/star.circlehost.key \
-out /etc/ssl/private/star.circlehost.crt
fi
if [[ ! -s /etc/ssl/private/star.circlehost.pem ]]
then
cat /etc/ssl/private/star.circlehost.key \
/etc/ssl/private/star.circlehost.crt \
> /etc/ssl/private/star.circlehost.pem
fi
(cat <<'EOF'
global
daemon
maxconn 4096
listen http
bind 0.0.0.0:13000
bind 0.0.0.0:14443 ssl crt /etc/ssl/private/star.circlehost.pem
mode tcp
server master 127.0.0.1:3000
timeout client 3600s
timeout connect 3600s
timeout server 3600s
listen fig-repl 0.0.0.0:17888
mode tcp
server master 127.0.0.1:7888
timeout client 3600s
timeout connect 3600s
timeout server 3600s
listen dev-repl 0.0.0.0:18230
mode tcp
server master 127.0.0.1:8230
timeout client 3600s
timeout connect 3600s
timeout server 3600s
listen figwheel
bind 0.0.0.0:13449
bind 0.0.0.0:14444 ssl crt /etc/ssl/private/star.circlehost.pem
mode tcp
server master 127.0.0.1:3449
timeout client 3600s
timeout connect 3600s
timeout server 3600s
EOF
) > /etc/haproxy/haproxy.cfg
# Generate HAProxy
haproxy -f /etc/haproxy/haproxy.cfg
lein repl :headless &
lein run
fi
exec "$@"