forked from djangopackages/djangopackages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver_bootstrap.sh
36 lines (27 loc) · 1.08 KB
/
server_bootstrap.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
#!/bin/bash
apt-get update
apt-get upgrade -y
# install prerequisites
apt-get install -y git supervisor apt-transport-https ca-certificates linux-image-extra-$(uname -r) apparmor
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
# install docker
touch /etc/apt/sources.list.d/docker.list
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" >> /etc/apt/sources.list.d/docker.list
apt-get update
apt-get purge lxc-docker
apt-cache policy docker-engine
apt-get update
apt-get install docker-engine
service docker start
# install docker compose
curl -L https://github.com/docker/compose/releases/download/1.6.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
# configure supervisor
sed -i '$ d' /etc/supervisor/supervisord.conf
echo "files = /code/*/supervisord.conf /code/*/docker-supervisord.conf" >> /etc/supervisor/supervisord.conf
# clone repo
mkdir /code
cd /code
git clone https://github.com/pydanny/djangopackages.git
# reload supervisor
supervisorctl reload