Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 933 Bytes

README.md

File metadata and controls

40 lines (28 loc) · 933 Bytes

Ansible Tutorial

A basic Django app with postgres as database deployed on DigitalOcean (droplet) via Ansible.

Environment variables

Create a .env file in the root of the cloned repository, with following variables:

POSTGRES_DB=sample
POSTGRES_USER=postgres
POSTGRES_PASSWORD="set strong password for postgres"
SUPERUSER_PASSWORD="set strong password for django admin dashboard"
DO_API_TOKEN="Digital Ocean token, if deploying"

Running the app

To run the app install docker and docker-compose. Build and run the app with following commands:

docker-compose build
docker-compose up

After running the commands above, the app should be running at: http://127.0.0.1:8000/

Deployment

This is deployed on Digital Ocean Droplet via Ansible. To deploy run the following command after docker-compose up:

docker-compose exec web ansible-playbook deployment/site.yml