-
Notifications
You must be signed in to change notification settings - Fork 2
/
install-cyclos.sh
executable file
·76 lines (66 loc) · 2.41 KB
/
install-cyclos.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
#!/bin/bash
RED="\033[0;31m"
GREEN="\033[0;32m"
NC="\033[0m"
#
# This file should be used to prepare and run your WebProxy after set up your .env file
# Source: https://github.com/evertramos/docker-compose-letsencrypt-nginx-proxy-companion
#
# 1. Check if .env file exists
if [ -e .env ]; then
source .env
else
echo "Please set up your .env file before starting your environment."
exit 1
fi
# 2. Create docker network
docker network create $NETWORK $NETWORK_OPTIONS
# 4. Download the latest version of nginx.tmpl
curl https://raw.githubusercontent.com/jwilder/nginx-proxy/master/nginx.tmpl > nginx.tmpl
# Check if user set to use Special Conf Files
if [ ! -z ${USE_NGINX_CONF_FILES+X} ] && [ "$USE_NGINX_CONF_FILES" = true ]; then
# Create the conf folder if it does not exists
mkdir -p $NGINX_FILES_PATH/conf.d
# Copy the special configurations to the nginx conf folder
cp -R ./conf.d/* $NGINX_FILES_PATH/conf.d
# Check if there was an error and try with sudo
if [ $? -ne 0 ]; then
sudo cp -R ./conf.d/* $NGINX_FILES_PATH/conf.d
fi
# If there was any errors inform the user
if [ $? -ne 0 ]; then
echo
echo "#######################################################"
echo
echo "There was an error trying to copy the nginx conf files."
echo "The webproxy will still work, your custom configuration"
echo "will not be loaded."
echo
echo "#######################################################"
fi
fi
# 7. Start application
echo "Initialize reverse proxy"
docker-compose -f proxy.yml up -d
echo "Initialize cyclos database"
docker-compose -f cyclos.yml up -d cyclos-db
echo "Waiting 2 min for db creation."
sleep 120
echo "Initialize cyclos application"
docker-compose -f cyclos.yml up -d cyclos-app
echo "Waiting 4 min for cyclos db tables creation."
sleep 240
echo "Initialize cyclos database automatic updates"
docker-compose -f cyclos.yml up -d pgbackups
sleep 10
echo "Initialize cyclos monitoring"
docker-compose -f monitoring.yml up -d
echo "Stopping Cyclos only"
docker-compose -f cyclos.yml down
echo "Final Cyclos start only"
docker-compose -f cyclos.yml up -d
echo "Cyclos will take up to 3 minutes to launch."
echo "You can check is Cyclos is launched with the following command, you should have :"
echo "INFO [main] org.apache.catalina.startup.Catalina.start Server startup in XXX ms"
echo "$ docker logs cyclos-app"
exit 0