Skip to content

notKeion/wordpress-docker-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WordPress + Caddy (Auto-HTTPS) — Ultra-Light Starter

Single docker-compose.yml that runs WordPress + MariaDB behind Caddy with automatic HTTPS via Let’s Encrypt.
Tuned to stay around ≤512 MB RAM. Fork it and ship simple brochure/blog sites fast.


What’s Inside

  • 🔐 Auto-HTTPS (Caddy + Let’s Encrypt) — zero config beyond domain + email
  • 🐳 Single compose file — no extra proxy files
  • 💾 Bind mounts: ./wp (site files) and ./dbdata (database)
  • ⚙️ Memory-trimmed MariaDB & WP caps for small droplets

Repo Layout

  • docker-compose.yml — Caddy + WordPress + MariaDB
  • .env.example — copy to .env and set secrets
  • wp/ — WordPress files (commit with .gitkeep)
  • dbdata/ — MariaDB data (commit with .gitkeep)

Quick Start (Local Development)

  1. Copy env and set values:
    cp .env.example .env
  2. For production, set:
    DOMAIN=yourdomain.com
    LETSENCRYPT_EMAIL=you@yourdomain.com
  3. Bring it up:
    docker compose up -d
  4. Open Site:
  5. Stop / Remove:
    docker compose down
    # Remove all data (careful!):
    # docker compose down -v && rm -rf wp/* dbdata/*

Deploy to DigitalOcean (Fast Path)

  1. SSH as root
    ssh root@YOUR_DROPLET_IP
  2. Install Docker Quickly
    curl -fsSL https://get.docker.com | sh
  3. Clone your fork and prep
    mkdir -p /opt && cd /opt
    git clone https://github.com/notKeion/wordpress-docker-starter.git wordpress-docker-starter
    cd wordpress-docker-starter
    
    cp .env.example .env
    # Set a real domain + email and strong DB passwords
    nano .env
    
    mkdir -p wp dbdata && touch wp/.gitkeep dbdata/.gitkeep
    Generate a secure password (Optionally, but recommended):
    # Strong hex password (64 chars ≈ 256-bit), great for .env values
    openssl rand -hex 32
  4. Open ports and start:
    # If you use UFW:
    ufw allow 22; ufw allow 80; ufw allow 443; ufw --force enable
    
    docker compose up -d
  5. Updating Later:
    cd /opt/wordpress-caddy-starter
    git pull --ff-only
    docker compose pull
    docker compose up -d --remove-orphans

Memory Tuning (if you hit OOM)

  • In docker-compose.yml:
    • Raise wordpress.mem_limit to 320m if WP admin/plugin installs restart PHP.
    • Raise db --innodb_buffer_pool_size to 96M (or 128M) for larger datasets.
  • Avoid heavy plugins; keep active plugins lean.

Common Commands

docker compose ps                 # show services
docker compose logs -f wordpress  # tail WP logs
docker compose logs -f db         # tail DB logs
docker compose exec wordpress bash  # shell into WP container

Database Backups

docker compose exec db sh -c \
'mysqldump -u"$MARIADB_USER" -p"$MARIADB_PASSWORD" "$MARIADB_DATABASE"' \
> db_backup.sql

Files: archive wp/ (uploads, themes, plugins).

About

A lightweight Docker-based WordPress starter template with MariaDB, ideal for quick project launches and future customization. Includes persistent volumes, clean network isolation, and simple environment configuration for rapid deployment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors