Skip to content

Latest commit

 

History

History
101 lines (67 loc) · 4.7 KB

README.md

File metadata and controls

101 lines (67 loc) · 4.7 KB

🐳 NPP Dockerized Docker Build

Welcome to the Docker project optimized for the (NPP) WordPress Plugin! 🎉 This full-stack Dockerized environment is designed for NPP, including WordPress with FPM, Nginx, MySQL, FastCGI, WP-CLI, phpMyAdmin, and necessary PHP extensions. It's tailored for easy deployment and efficient use of the NPP plugin

Explore the NPP Main GitHub Repository to access the heart of the plugin development.

npp-docker.mp4

🔊™️ In The Silence - Giuseppe Ottaviani

✨ Features

  • WordPress (6.7.2) with PHP-FPM (8.2)
  • MySQL (8) for database management
  • FastCGI cache ready with Nginx (1.27.4)
  • WP-CLI ready for plugin and theme installations (check .env)
  • phpMyAdmin (5.2.2) ready
  • ✅ Includes all dependencies required for the NPP plugin
  • ✅ Isolated and secure PHP process owner for enhanced security and performance
  • ✅ Built with bindfs (1.17.7) + fuse3 (1.16.2) for FUSE-based mounting of Nginx Cache Path
  • ✅ Installed a wide range of PHP extensions
  • ✅ Easily switch between the stable release and the bleeding-edge version of the NPP
  • ✅ All containers powered by Debian 12 for a stable, consistent environment
  • ✅ Compatible with both Windows WSL and Linux Hosts

🔑 Environment Variables

This repository was primarily created for testing and developing the NPP plugin on local. However, with minor adjustments, It can also be used as a production environment.

Please check the .env file for the environment variables used in the project. Some variables can be directly modified by the user for easy customization, while others are derived from the original Dockerfiles of core services. Changing these core variables for a production environment may require adjustments in other parts of the project to maintain seamless integration and workflow. Feel free to customize it to suit your full-stack WordPress production needs!

Use the Bleeding-Edge Version of NPP (Default)

If you want to use the latest bleeding-edge version of the NPP plugin simply set the following environment variable:

NPP_EDGE=1

🔄 This will sync the plugin with the latest development branch commit from GitHub, ensuring you always have access to the newest features and improvements.

⚠️ In Production

To enable Nginx Cache Preload in a localhost development environment, a small host configuration adjustment is always required. In production, this may or may not be required depending on your Docker architecture. If you encounter a Cache Preload issue in production, try enabling the below setting in .env, otherwise, you can disable it entirely.

NPP_HACK_HOST=1

For a full explanation and to adjust your environment, please read the complete story here:

# To enable NPP Plugin Nginx Cache Preload action:

⚙️️ Instant Deployment

1. Clone the repository

Start by cloning the repository to your local machine:

git clone https://github.com/psaux-it/wordpress-nginx-cache-docker.git
cd wordpress-nginx-cache-docker

2. Run the Services

Run the following command to build and start the container:

  • Using pre-built images:
docker compose up
  • Building locally:
docker compose up --build

🚀 Post-Container Startup Access

  • The WordPress site can be accessed at the host machine:

  • Default WordPress wp-admin login credentials:

    • Username: npp
    • Password: npp
  • You can also access phpMyAdmin at:

  • Default FUSE mount path:

    • /var/cache/nginx-npp
    • Use the FUSE mount path as the Nginx cache path in the NPP plugin settings page.

⚠️ Important Notices

🚨 The included SSL certificates are dummy, strictly for local usage and must not be used in production environments.
📦 This project leverages the fantastic work by Michele Locati to streamline the installation of required PHP extensions.