Flash 75 swap to using nginx ansible docker#17
Open
ree13d wants to merge 46 commits into
Open
Conversation
…se host isnt fetchable from most of the post bodies, we could use host = request.get_host() instead but id rather just fix the app to use django models
…com:AusSRC/FLASH into FLASH-75-Swap-to-using-Nginx-ansible-docker
…e staticfiles generate on deploy rather than in dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DONT MERGE JUST YET, IRONING OUT A BUG
Merge Request: Infrastructure, Deployment & Developer Experience Overhaul
Overview
This MR introduces a set of improvements aimed at stabilising and simplifying three core areas:
1. Local Development Experience Improvements
Improves the ability to develop and test the application locally with minimal friction:
Simplified workflows for:
More consistent parity between local and production-like environments via Docker
2. Build & Deployment Reliability
This change significantly improves reproducibility and deployment stability:
The Django application is now fully containerised using Docker
Dependency management is standardised via
pyproject.tomlApplication startup is handled through
docker-composeUses a stable Alpine-based nginx container for TLS termination
nginx is now responsible for:
3. Infrastructure Provisioning (VM Setup via Runbook)
A major addition is the ability to provision a VM from near-scratch using a runbook.
The runbook automates:
SSH setup and hardening
Firewall provisioning
Docker installation
Creation of a restricted
deployuser (CI-only SSH access for deployment)Docker service configuration to:
Environment and secrets setup
Key outcome:
A VM can now be fully built and deployment-ready on demand via a repeatable process.
4. Security & Operational Hardening
Fail2ban
Firewall (UFW)
5. Secrets Management
.gitignoreand.dockerignore(please verify locally)settings.pyis no longer treated as sensitive and should not contain credentials or secretsSecret Injection Model
Note:
This improves isolation and control compared to the previous setup, but secrets still exist as files on the VM.
Future improvement direction:
Migrate to a proper secrets manager:
6. Logging & Session Handling
Media/session cleanup behaviour:
Summary
This MR establishes a more production-grade foundation by:
(Note: I wrote my own MR description which ended up like 4x A4 pages of solid text and asked a LLM to summarise it, no sensitive or identifying info was included)
(Note2: I am sure the ansible runbooks could be optimized, tightend up, have some more useful tools that we expect in it to be added etc, we should iterate on it.)
(Note3: This new VM+CI/CD doesnt handle pipeline cronjobs triggering yet, but thats next on my todo)