The Alob-Server is deployed with docker, nginx and gunicorn.
How to deploy Alob in the cloud. This documentation is valid for Ubuntu 16.04.3 LTS
Update the machine and clear old packages.
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo apt autoremove
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main'
sudo apt-get update
sudo apt-get install -y docker-engine
sudo curl -L https://github.com/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo usermod -aG docker ubuntu
git clone SOURCE_LINK
git clone https://github.com/busino/alob.git
cd alob
mkdir data
cd data
sudo ln -s ../alob_django/media/ .
cd ..
docker-compose up -d
docker-compose exec web /bin/bash
web> python manage.py makemigrations image pair prediction
web> python manage.py migrate
web> python manage.py loaddata dump.json
Make sure that ALLOWED_HOST is correctly set in alob_django/alob_django/settings.py.
There is a python script backup_db.py that have to be adapted to be used in your environment. If you have a S3-compatible object storage, the user credentials have to be adapted.
sudo apt-get install -y python3-boto3
crontab -e
# every day at 2am
0 2 * * * /usr/bin/python3 /home/ubuntu/alob/backup_db.py > /home/ubuntu/alob/log/backup.log 2>&1
The script backup_data.py can be used to create a zipped tar-archive of the data-folder to be used as a backup of the user data.