Skip to content

Commit

Permalink
Add documentation for setting it up
Browse files Browse the repository at this point in the history
  • Loading branch information
aktech committed May 27, 2020
1 parent 76ae708 commit 794df9a
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 5 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# 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:

```bash
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

Expand All @@ -13,3 +26,15 @@ docker-compose build
```bash
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`:

```bash
docker-compose exec web ansible-playbook deployment/site.yml
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 0 additions & 5 deletions deployment/main.yml

This file was deleted.

5 changes: 5 additions & 0 deletions deployment/site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- import_playbook: digital_ocean_droplet.yml
- import_playbook: docker_setup.yml
- import_playbook: clone_repository.yml
- import_playbook: compose_start.yml

0 comments on commit 794df9a

Please sign in to comment.