# Prepare docker
apt-get update
apt-get install -y docker.io
# docker pull docker.futuredial.com/isd_redis
# docker pull docker.futuredial.com/isd_postgres
# docker pull docker.futuredial.com/isd_pgbouncer
# docker pull docker.futuredial.com/isd_server:1.8.1

# Install settings
rm -r /var/www/isd/installer/1.8.1/
apt install -y wget supervisor
wget http://cmc-dl.futuredial.com/tools/isd/isd_installer_1.8.1.tar.gz
mkdir -p /var/www/isd/installer/1.8.1/
mkdir -p /var/www/isd/log/
tar zxvf isd_installer_1.8.1.tar.gz -C /var/www/isd/installer/1.8.1/
cd /var/www/isd/installer/1.8.1/
docker load < isd_redis.tar
docker load < isd_postgres.tar
docker load < isd_pgbouncer.tar
docker load < isd_server_1.8.1.tar
cp isd.conf /etc/supervisor/conf.d/isd.conf
cp start_redis.sh /var/www/isd/start_redis.sh
cp start_postgres.sh /var/www/isd/start_postgres.sh
cp start_pgbouncer.sh /var/www/isd/start_pgbouncer.sh
cp start_server.sh /var/www/isd/start_server.sh
systemctl enable docker
service supervisor restart
