Skip to content

Ansible Playbook for DemocracyOS provision using Docker Compose

Notifications You must be signed in to change notification settings

DemocracyOS/onpremises

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DemocracyOS On-premises

Given a Ansible Playbook, we are going to provision and start DemocracyOS on a CentOS/RedHat/Ubuntu VM.

Requirements

  • Make sure to have Ansible 2.1.0.0 or greater installed locally (Installation Guide)
  • Clone this repo and make sure to have the necessary roles with:
    • ansible-galaxy install -p ./roles -r ./requirements.yml

Provisioning

First, make sure to have a VM (where DemocracyOS is going to run) with root access to it, and can login with your SSH Key. If you don't know how to do any of that, follow this tutorial.

Then, you will have to customize how your environment is going to run. To do that you have to create an Inventory file and a configuration file with your custom variables. Use as reference inventories/example and inventories/example.yml. The file names should be the same as your environment, e.g.: inventories/staging and inventories/staging.yml.

Lastly, just run:

ansible-playbook playbook.yml -i inventories/<path to your inventory file>

This command is going to execute all the tasks defined at playbook.yml; if you need to know how that works, here's the official docs.

## How to manage your running VM

Inside your VM, you can run the following commands:

# Deploy a new Docker image
docker pull democracyos/democracyos:latest && docker-compose -f /usr/src/docker-compose.yml restart -d
# See the logs
docker-compose -f /usr/src/docker-compose.yml logs --follow
# View all the services running
docker-compose -f /usr/src/docker-compose.yml ps
# Connect to the running MongoDb console
docker exec -it src_mongo_1 mongo democracyos-staging
# Connect to the image running DemocracyOS
docker exec -it src_app_1 bash
# Scale the number of DemocracyOS instances running
docker-compose -f /usr/src/docker-compose.yml scale app=3

MongoDB Backups

If you're running on staging or production environment, everyday at 23:59 a dump of the entire database will be saved to /usr/src/backups. You can check the file templates/backup.j2 to see what it does.

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%