Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Latest commit

 

History

History
83 lines (56 loc) · 4.07 KB

digital-ocean.md

File metadata and controls

83 lines (56 loc) · 4.07 KB

Digital Ocean installation

This guide will show you how to deploy Open Event Android App Generator on Digital Ocean. The basic idea is installing Docker on Digital Ocean droplet and then running Open Event in it.

Phase 1

  • Create a droplet with Ubuntu x64 as the image. At the time of writing this guide, Ubuntu 16.04.1 was used.

  • Choose a size with atleast 1 GB RAM. We found 512 MB RAM to be insufficient when running Open Event inside Docker.

  • Choose other options according to need and then 'Create' the droplet.

  • Once droplet has been created, you will get email from DigitalOcean with its information IP Address, username and password.

droplet_email

  • Open a terminal window and ssh into the server. The command is ssh USERNAME@IP. When run, it will ask for the password you got through email. Ctrl-Shift-V to paste the password and ENTER. An example has been given below.
ssh [email protected]
# Enter password you got in the email and enter
  • If you are ssh'ing into your droplet for the first time, you will get a prompt to change password. The step is compulsary so change the password here. Once this step is done, you will be running the droplet's shell.

Phase 2

The steps that will be mentioned now are analogous to running Open Event Android App Generator on Docker documentation. You are recommended to first go through it to appreciate the similarities.

  • Now as we have just initialized our brand new server, the first step is to install Docker. DigitalOcean has a nice guide on installing Docker in Ubuntu 16.04 so follow it. I took the commands from that guide and have written them here. You can copy paste the following into the droplet's ssh shell.
sudo apt-get update
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update
apt-cache policy docker-engine
sudo apt-get install -y docker-engine
sudo systemctl status docker
  • Next step is to install Docker-Compose. Following the DigitalOcean guide, run the following commands in the ssh shell to install compose.
sudo apt-get -y install python-pip
sudo pip install docker-compose
  • Now that Docker and Compose are setup, it's time to build the image. The next steps are very similar to the running Open Event Android App Generator on Docker tutorial so please see it.

  • We will start by cloning the GitHub Open Event Android repo and cd'ing into it's directory. Then we will set the SERVER_NAME and then build and run the image.

git clone https://github.com/fossasia/open-event-android.git && cd open-event-android
export SERVER_NAME=104.236.228.132
docker-compose build
docker-compose up
  • The above commands will have the generator running. That's it. Visit the $IP (example 104.236.228.132) to view the open event server. You can close the 2nd terminal window if you wish.

NOTES

  • For demonstration purposes, I ran the server in normal mode. ( docker-compose up ) The server will die as soon as the first terminal window is closed. To not let that happen, start the the server as daemon.
docker-compose up -d
  • If you haven't added a domain name to your DO droplet and are accessing it through the IP, you might face the problem of not being able to login. This is a Chrome issue and may exist in other browsers too (haven't tested). Learn more about it in this Stack Overflow answer. The only way to solve this is by attaching a domain name to your droplet.

  • SERVER_NAME should be the same as the domain on which the project is running. Don't include http, https, www etc in server name. Also don't include the trailing '/' in the domain name.