ComposePress/README.md

2.2 KiB

ComposePress

A Docker-based toolkit that streamlines WordPress upgrades using official images. Provides pre-configured docker-compose files, Dockerfiles, and standardized procedures to make WordPress maintenance more predictable and reliable.

Project Configuration

Project Name

This project requires a project name, which should be defined in an .env file:

COMPOSE_PROJECT_NAME=test

Database Host Configuration

To avoid conflicts, use the following format for the database host:

WORDPRESS_DB_HOST=${COMPOSE_PROJECT_NAME}-database-1:3306

Environment Variables

Docker Images

# Web and Database Images
IMAGE_WEB=test_web_staging
IMAGE_DATABASE=mariadb:11.5

Let's Encrypt Configuration

VIRTUAL_HOST=test.test.org
LETSENCRYPT_HOST=test.test.org
LETSENCRYPT_EMAIL=test@test.com
LETSENCRYPT_TEST=true

Database Configuration

WORDPRESS_DB_HOST=${COMPOSE_PROJECT_NAME}-database-1:3306
WORDPRESS_DB_PASSWORD=wordpress
MYSQL_ROOT_PASSWORD=wordpress
MYSQL_DATABASE=wordpress
MYSQL_USER=wordpress
MYSQL_PASSWORD=wordpress

Volume Configuration

# External Volumes
DB_VOLUME=test_db_staging
CONTENT_VOLUME=test_content_staging

# Recreated Volumes
HTML_VOLUME=test_html_staging

Usage

Upgrade Process

  1. Stop the current containers and remove volumes:
docker compose down -v
  1. Update WordPress version:

    • Modify version in Dockerfile.wordpress_fpm
    • Update IMAGE_WEB in .env file
  2. Build and test the new environment:

# Build initial configuration
docker compose -f docker-compose.first.yml build 

# Test the build
docker compose -f docker-compose.first.yml up -d

# Stop test environment
docker compose -f docker-compose.first.yml down

# Start production environment
docker compose up -d
  1. Migrate content:
# In the wordpress service, copy new content to production
cp -a wp-content-new/* wp-content/

# Verify permissions on wp-content directory
chmod -R [appropriate-permissions] wp-content/
  1. Optional: Update database if needed:
./update-db

Requirements

Docker

Contributing

@bike

License

GNU GENERAL PUBLIC LICENSE