Skip to content

Update README.md #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 36 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,53 @@
# 🐳 NPP Dockerized [![Docker Build](https://github.com/psaux-it/wordpress-nginx-cache-docker/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/psaux-it/wordpress-nginx-cache-docker/actions/workflows/docker-publish.yml)

Welcome to the Docker project optimized for the **[(NPP) WordPress Plugin](https://wordpress.org/plugins/fastcgi-cache-purge-and-preload-nginx/)**! 🎉 This full-stack Dockerized environment is designed for **NPP** usage, including **WordPress**, **PHP-FPM**, **Nginx**, **MySQL**, **FastCGI cache**, **WP-CLI**, and necessary **PHP extensions**. It's tailored for easy deployment and efficient use of the **NPP plugin**, providing a comprehensive solution for **Nginx Cache** management on wordpress.
Welcome to the Docker project optimized for the **[(NPP) WordPress Plugin](https://wordpress.org/plugins/fastcgi-cache-purge-and-preload-nginx/)**! 🎉 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](https://github.com/psaux-it/nginx-fastcgi-cache-purge-and-preload)** to access the heart of the plugin development.

## 🔧 Features
## Features

- ✅ **WordPress** (6.7.1) with **PHP-FPM** (8.2)
- ✅ **WordPress** (6.7.2) with **PHP-FPM** (8.2)
- ✅ **MySQL** (8) for database management
- ✅ **FastCGI** cache ready with **Nginx** (1.27.3)
- ✅ **WP-CLI** ready for plugin and theme installations (safe without --allow-root)
- ✅ **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**
- ✅ Supports a wide range of **PHP extensions**
- ✅ Easily switch between the **stable** release and the **bleeding-edge dev** version of the **NPP**
- ✅ 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 Windows WSL and Linux Hosts
- ✅ Compatible with both Windows **WSL** and Linux Hosts

## 🔑 Environment Variables

Please check the **.env** file for the environment variables used by the project.
**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.

Some variables can be directly modified by the user to customize the setup easily, while others are hard depend to the project's core configuration. Modifying these core variables for a production environment may require adjustments in other parts of the project to ensure proper integration and workflow. Feel free to customize it to meet your full-stack WordPress **production** needs!
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 or Contribute to Development (Default)
### Use the Bleeding-Edge Version of NPP (Default)

If you want to use the **latest bleeding-edge version** of the NPP plugin or set up a **development/test environment**, simply set the following environment variable:
If you want to use the latest **bleeding-edge version** of the NPP plugin simply set the following environment variable:

```bash
NPP_DEV_ENABLED=1
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.

## ⚙️️ Setup Instructions
### ⚠️ 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.

```bash
NPP_HACK_HOST=1
```

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

https://github.com/psaux-it/wordpress-nginx-cache-docker/blob/1c8043a0bc6e2014b55ae6f7259eba134e3f3698/wordpress/wp-post.sh#L129

## ⚙️️ Instant Deployment

### 1. Clone the repository

Expand All @@ -47,18 +60,18 @@ cd wordpress-nginx-cache-docker

### 2. Run the Services

Run the following command to build and start the container in detached mode:
Run the following command to build and start the container:

- **Using pre-built images:**

```bash
docker compose up -d
docker compose up
```

- **Building locally:**

```bash
docker compose up -d --build
docker compose up --build
```

### 🚀 **Post-Container Startup Access**
Expand All @@ -70,8 +83,12 @@ docker compose up -d --build
- **Username**: `npp`
- **Password**: `npp`

### 🔧 **Nginx Cache Path Configuration**
- Users can use the FUSE mount path **`/var/cache/nginx-npp`** as the Nginx cache path in the NPP plugin settings page.
- You can also access **phpMyAdmin** at:
- https://localhost/phpmyadmin

- 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
Expand Down