Skip to content

zexarcore/wordpress-fse-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

WordPress - Full Site Editing, FSE

A modern and secure WordPress project that uses Docker to simplify development and deployment. This project includes optimized configurations for both production and local development.

πŸš€ Technologies Used

  • WordPress - Content Management System
  • Docker & Docker Compose - Containerization and orchestration
  • MySQL - Database
  • PHP - Backend programming language
  • Composer - PHP dependency manager
  • Akismet - Anti-spam plugin
  • JWT Authentication - Secure authentication for REST API
  • vlucas/phpdotenv - Environment variable management

πŸ“ Project Structure

wordpress/
β”œβ”€β”€ πŸ“„ composer.json              # PHP dependencies
β”œβ”€β”€ πŸ“„ composer.lock              # Locked PHP dependencies
β”œβ”€β”€ πŸ“„ docker-compose.yml         # Docker services configuration (port 9000)
β”œβ”€β”€ πŸ“„ Dockerfile                 # WordPress container configuration
β”œβ”€β”€ πŸ“„ .dockerignore              # Docker ignore rules
β”œβ”€β”€ πŸ“„ deploy.yml                 # Deployment configuration
β”œβ”€β”€ πŸ“„ environment.php            # Environment configuration
β”œβ”€β”€ πŸ“„ .gitignore                 # Git ignore rules
β”œβ”€β”€ πŸ“„ .htaccess                  # Apache configuration
β”œβ”€β”€ πŸ“„ wp-config.php              # WordPress configuration
β”œβ”€β”€ πŸ“„ wp-config-sample.php       # Sample WordPress configuration
β”œβ”€β”€ πŸ“„ index.php                  # WordPress entry point
β”œβ”€β”€ πŸ“„ wp-*.php                   # WordPress core files
β”œβ”€β”€ πŸ“„ xmlrpc.php                 # XML-RPC endpoint
β”œβ”€β”€ πŸ“„ scripts/
β”‚   β”œβ”€β”€ πŸ“„ start.sh              # Startup script
β”‚   └── πŸ“„ check-ports.sh        # Port conflict checker
β”œβ”€β”€ πŸ“ logs/                      # Application logs
β”œβ”€β”€ πŸ“ mysql/
β”‚   └── πŸ“ init/
β”‚       └── πŸ“„ 01-init.sql       # DB initialization script
β”œβ”€β”€ πŸ“ vendor/                    # Composer dependencies
β”œβ”€β”€ πŸ“ wp-admin/                  # WordPress admin panel
β”œβ”€β”€ πŸ“ wp-content/                # Custom content
β”‚   β”œβ”€β”€ πŸ“ plugins/              # Installed plugins
β”‚   β”‚   β”œβ”€β”€ akismet/             # Anti-spam plugin
β”‚   β”‚   β”œβ”€β”€ hello.php            # Hello Dolly plugin
β”‚   β”‚   β”œβ”€β”€ jwt-authentication-for-wp-rest-api/  # JWT authentication
β”‚   β”‚   β”œβ”€β”€ secure-custom-fields/ # Secure custom fields
β”‚   β”‚   └── woocommerce/         # E-commerce plugin
β”‚   β”œβ”€β”€ πŸ“ themes/               # Custom themes
β”‚   β”‚   β”œβ”€β”€ classic-core-theme/  # Classic core theme
β”‚   β”‚   β”œβ”€β”€ core-theme/          # Core theme (parent)
β”‚   β”‚   β”œβ”€β”€ core-theme-child/    # Core theme child (FSE ready)
β”‚   β”‚   └── index.php            # Theme index
β”‚   β”œβ”€β”€ πŸ“ languages/            # Translation files
β”‚   β”œβ”€β”€ πŸ“ uploads/              # Media files
β”‚   └── πŸ“ cache/                # Cache files
β”œβ”€β”€ πŸ“ wp-includes/               # WordPress core files
└── πŸ“„ README.md                  # This file

πŸ”§ Access Port: The project is configured to run on port 9000 (http://localhost:9000)

πŸ› οΈ Onboarding - Getting Started

Prerequisites

Before you begin, make sure you have installed:

2. Configure Environment Variables

Create a .env file at the project root:

cp .env.example .env

Edit the .env file with your settings:

# Database Configuration
WORDPRESS_DB_HOST=mysql
WORDPRESS_DB_USER=wordpress
WORDPRESS_DB_PASSWORD=wordpress_password
WORDPRESS_DB_NAME=wordpress

# WordPress Configuration
WORDPRESS_DEBUG=true
WORDPRESS_CONFIG_EXTRA=

# JWT Configuration
JWT_AUTH_SECRET_KEY=your_very_long_and_secure_secret_key

# FTP Configuration (for deployment)
FTP_SERVER=your_ftp_server
FTP_USERNAME=your_ftp_user
FTP_PASSWORD=your_ftp_password
DEPLOY_DIR=/path/on/server

3. Start the Project with Docker

Option A: Using Docker Compose (Recommended)

# Build and start all services
docker-compose up -d

# View logs in real time
docker-compose logs -f

# Stop the services
docker-compose down

Option B: Using the Startup Script

# Give execution permissions to the script
chmod +x scripts/start.sh

# Run the startup script
./scripts/start.sh

4. Access the Application

Once the containers are running:

πŸ”“ HTTP Access (Recommended for development)

πŸ”’ HTTPS Access (Optional)

If you need HTTPS for development:

# 1. Generate SSL certificates
./scripts/generate-ssl.sh

# 2. Start with SSL
docker-compose -f docker-compose.yml -f docker-compose.ssl.yml up -d

# 3. Access with HTTPS
- **WordPress Frontend**: https://localhost
- **WordPress Admin**: https://localhost/wp-admin

⚠️ Note: For local HTTPS, you will need to configure the certificate in your browser or use special flags.

5. Initial WordPress Setup

  1. Go to http://localhost:9000
  2. Select your language
  3. Complete the site information:
    • Site title
    • Admin user
    • Password
    • Email
  4. Click "Install WordPress"

πŸ”§ Useful Commands

Docker Compose

# Check the status of services
docker-compose ps

# Rebuild containers
docker-compose up -d --build

# Run commands inside the container
docker-compose exec wordpress wp --info

# View logs for a specific service
docker-compose logs wordpress

# Stop and remove containers
docker-compose down -v

WordPress CLI

# View WordPress information
docker-compose exec wordpress wp --info

# List plugins
docker-compose exec wordpress wp plugin list

# Activate plugin
docker-compose exec wordpress wp plugin activate plugin-name

# Update WordPress
docker-compose exec wordpress wp core update

Database

# Access MySQL
docker-compose exec mysql mysql -u wordpress -p wordpress

# Backup the database
docker-compose exec mysql mysqldump -u wordpress -p wordpress > backup.sql

# Restore backup
docker-compose exec -T mysql mysql -u wordpress -p wordpress < backup.sql

πŸš€ Deployment

Deployment with Docker

To deploy to production:

About

A modern, secure, and fully containerized WordPress development environment powered by Docker. Includes optimized configurations for local development and production, custom themes (with Full Site Editing), essential plugins, and developer-friendly scripts for rapid setup and deployment.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors