-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·30 lines (27 loc) · 903 Bytes
/
run.sh
File metadata and controls
executable file
·30 lines (27 loc) · 903 Bytes
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
#!/bin/bash
script_dir=$(dirname $0)
haproxy_certs_dir=${script_dir}/haproxy/certs
mkdir -p $haproxy_certs_dir
if [ ! -f "${haproxy_certs_dir}/haproxy.pem.key" ]; then
openssl req -x509 -newkey rsa:4096 -sha256 -days 365 -nodes \
-keyout "${haproxy_certs_dir}/haproxy.pem.key" -out "${haproxy_certs_dir}/haproxy.pem" -extensions san -config \
<(echo "[req]";
echo distinguished_name=req;
echo "[san]";
echo subjectAltName=DNS:localhost,DNS:127.0.0.1.nip.io,IP:127.0.0.1
) \
-subj /CN=devhost
chmod 755 $haproxy_certs_dir
chmod 644 ${haproxy_certs_dir}/*
fi
down="$1"
if [ "$down" != "" ]; then
docker compose down
else
if [ "${DOCKER_COMPOSE_BUILD}x" != "x" ]; then
docker compose up -d --build --force-recreate || exit 1
docker compose logs -f
else
docker compose up -d --force-recreate || exit 1
fi
fi