Skip to content

scale600/oci-flarum-devops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OCI Flarum DevOps

Production-ready DevOps project for deploying a Flarum community forum on Oracle Cloud Infrastructure (OCI) Always Free Tier.

Project Overview

This project provisions and configures the complete infrastructure for a Flarum forum — fully automated, from bare metal to a running application.

  • Infrastructure as Code (Terraform) provisions OCI compute, networking, and security resources
  • Configuration Management (Ansible) handles OS-level setup, Docker, firewalld, and service orchestration
  • Containerized Application (Docker Compose) runs Flarum + MySQL as isolated services
  • CI/CD Pipeline (GitHub Actions) triggers deployment on every push to main
  • Always Free Tier cost optimization — zero infrastructure cost on OCI

Architecture

┌─────────────────────────────────────────────────────────────┐
│                    OCI Always Free Tier                     │
│                                                             │
│  ┌─────────────────────────────────────────────────────────┐│
│  │                   Public Subnet                         ││
│  │                                                         ││
│  │  ┌───────────────────────────────────────────────────┐  ││
│  │  │           Flarum Web Server (VM.Standard.E2.1)     │  ││
│  │  │              1 OCPU / 1 GB RAM                    │  ││
│  │  │                                                   │  ││
│  │  │  ┌──────────────┐           ┌──────────────────┐  │  ││
│  │  │  │    Flarum    │◄─────────►│      MySQL       │  │  ││
│  │  │  │  Container   │           │    Container     │  │  ││
│  │  │  └──────────────┘           └──────────────────┘  │  ││
│  │  └───────────────────────────────────────────────────┘  ││
│  └─────────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────────┘

Tech Stack

Infrastructure & Orchestration

Category Technology Purpose
Cloud Provider OCI Always Free Tier Compute, networking, zero-cost hosting
IaC Terraform (>= 1.0) Declarative infrastructure provisioning
Provider Oracle/OCI (~> 5.0) Terraform provider for OCI resources
Config Management Ansible (7.0) Server configuration, service deployment

Containerization

Category Technology Purpose
Runtime Docker + Docker Compose Container orchestration on the instance
App Image mondedie/flarum:stable Official Flarum community image
Database Image mysql:8.0 MySQL with custom my.cnf tuning
Web Server nginx:alpine Reverse proxy (optional, TLS termination)

Application

Category Technology Purpose
Forum Flarum PHP-based lightweight community forum
Database MySQL 8.0 Data persistence with InnoDB
Search MySQL Full-Text Built-in search (no Elasticsearch dependency)

CI/CD & Automation

Category Technology Purpose
CI/CD Platform GitHub Actions Automated pipeline triggered on push/PR
Container Registry GitHub Container Registry (ghcr.io) Docker image storage
Build Docker Buildx Multi-architecture, cached builds
SSH appleboy/ssh-action Remote command execution for health checks
Linting ansible-lint, yamllint Playbook and YAML validation

Security

Category Technology Purpose
Network Isolation VCN + Subnets Public/private subnet separation
Firewall Security Lists + firewalld Port-level access control
Authentication SSH Key Key-only instance access
TLS Let's Encrypt / Certbot Free SSL certificate automation
Secrets GitHub Secrets Encrypted credential storage

Operating System

Category Technology Purpose
OS Oracle Linux 8 OCI-optimized Linux distribution
Init cloud-init / user_data First-boot instance configuration
Package Manager dnf RPM-based package installation

Directory Structure

.
├── terraform/           # Infrastructure as Code
│   ├── main.tf          # VCN, subnets, compute, security
│   ├── variables.tf     # Input variable declarations
│   ├── outputs.tf       # Output values (IPs, URLs)
│   ├── user_data.sh     # Web server cloud-init script
│   └── mysql_user_data.sh
├── ansible/             # Configuration Management
│   ├── playbook.yml     # Server provisioning playbook
│   └── templates/       # Jinja2 templates (docker-compose, env, setup)
├── docker/              # Container Images
│   ├── flarum/          # Flarum Dockerfile + setup script
│   └── mysql/           # MySQL Dockerfile + custom config
├── .github/             # CI/CD
│   ├── workflows/       # GitHub Actions workflow definitions
│   └── SECRETS_SETUP.md # Detailed secrets configuration guide
└── README.md

License

MIT — see LICENSE for details.

About

Production-ready DevOps pipeline for deploying Flarum community forum on OCI Always Free Tier — Terraform · Ansible · Docker · GitHub Actions

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors