-
Notifications
You must be signed in to change notification settings - Fork 256
/
setup-https.sh
executable file
·25 lines (25 loc) · 1 KB
/
setup-https.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
#!/bin/bash
echo "Setup Mercury with HTTPS"
if [[ $# -ne 1 ]]; then
echo "Please specify your domain" >&2
exit 2
fi
echo "Set domain to $1 in docker/init-letsencrypt.sh"
sed -i "s/{{your_domain}}/$1/g" docker/init-letsencrypt.sh
echo "Set domain to $1 in docker/nginx/pro/default.conf"
sed -i "s/{{your_domain}}/$1/g" docker/nginx/pro/default.conf
echo "[Done] Domain set"
echo "---------------------------------------------------------"
mv docker/init-letsencrypt.sh init-letsencrypt.sh
echo "Build docker-compose:"
sudo docker-compose -f docker-compose-https.yml build
echo "[Done] Docker-compose build"
echo "---------------------------------------------------------"
echo "Initialize SSL certificates"
sudo ./init-letsencrypt.sh
echo "[Done] SSL certificates issued"
echo "---------------------------------------------------------"
echo "Start service"
sudo docker-compose -f docker-compose-https.yml up --build -d
echo "[Done] Mercury is running"
echo "---------------------------------------------------------"