Managing multiple domains and static sites can quickly become a tangled mess of DNS records, deployment configs, and hosting bills. Here's how I've built a streamlined, nearly free infrastructure that scales ever time I buy a domain or have an idea I want to try on the public internet.

The Stack at a Glance

I run GitLab, Directus, and Immich on a local server which builds and pushes containers to GitLab's container registry. The Oracle Cloud instance only needs access to pull images from that registry, keeping the attack surface minimal.

Domain Registration & DNS

Porkbun offers competitive pricing and a proper API. When I purchase a new domain, I update my Terraform configuration and run terraform apply. The Cloudflare provider handles:

  • DNS records (A, CNAME, TXT)
  • SSL/TLS settings (Full strict)
  • Page rules and redirects
  • Caching configuration
  • Email routing
resource "cloudflare_record" "root" {
  zone_id = cloudflare_zone.domain.id
  name    = "@"
  value   = var.oracle_ip
  type    = "A"
  proxied = true
}

A few lines of HCL gets me a new parked domain with email routing and Cloudflare proxy protection.

The Oracle Free Tier

Oracle's Always Free tier is useful for serving a small amount of traffic. This server hosts multiple static sites via Docker containers, with Coolify+Traefik managing deployments.

CI/CD Pipeline

The self-hosted GitLab instance handles all the heavy lifting. When I push changes:

The .gitlab-ci.yml is straightforward:

stages:
  - build
  - deploy

build:
  stage: build
  script:
    - docker build -t registry.example.com/site:latest .
    - docker push registry.example.com/site:latest

deploy:
  stage: deploy
  script:
    - curl -X POST $COOLIFY_WEBHOOK_URL

Why Coolify?

Coolify acts as a self-hosted alternative to Vercel or Netlify. It:

  • Monitors container registries for new images
  • Handles zero-downtime deployments
  • Manages SSL certificates
  • Provides a clean UI for non-technical updates

When GitLab pushes a new image and triggers the webhook, Coolify pulls it and seamlessly swaps out the running container.

Content Management

Directus serves as the headless CMS for all sites. At build time, the static site generators fetch content via the Directus API. This keeps the sites truly static while allowing easy content updates.

Immich handles photo management where the galleries on my sites pull directly from Immich albums. I can manage photos from my phone and they automatically appear on the web.

The Complete Picture

Cost Breakdown

Service Cost
Oracle Cloud Free
Cloudflare Free
Domains (Porkbun) ~$10/year each
GitLab Free (self-hosted)
Coolify Free (self-hosted)
Directus Free (self-hosted)
Immich Free (self-hosted)

The only recurring cost is domain registration. Everything else runs on free tiers or self-hosted open source software.

Takeaways

  1. Terraform for managing multiple domains. Manual DNS updates don't scale.
  2. Oracle's free tier is capable for hosting multiple services and small amounts of traffic.
  3. Self-hosted GitLab + Coolify gets Vercel-like DX without bills
  4. Cloudflare as a proxy adds security, caching, and DDoS protection at no cost + API management

This setup has been running reliably for over a year, replacing a Dokku instance before that. This has handled everything from personal blogs, app support websites and client projects. The initial investment in automation + AI dev has paid dividends every time I spin up a new site.