Deploying Django to Digital Ocean

Published on September 17, 2024 | Last updated on September 17, 2024

Although not strictly part of the Personal Microservices Infrastructure Project series, this blog post will discuss building and deploying a basic Django application.

Secrets:

  • Postgres
  • Django admin
  • Django token
  • SSH Keys
  • Ansible Vault Password

Ansible

2 Docker Images

  • Nginx
  • Django

Questions:

Should .env file be backed into container? No - Can be loaded by compose.yaml - Possibly store in ansible vault, then copied to production box

What server deploys to production Probably a DroneCI runner. It will need an SSH deploy key to prod DO box.

Digital Ocean Load Balancer DO Box, with docker compose situation. This has nginx, postgres, celery etc.

Should I pay DO for a managed database? Probably

What does local development look like?

There will be a a few environments: - Fully local with sqlite - Local in compose (possibly should add a DNS situation and run through gateway) -