https://github.com/trafex/docker-wordpress
WordPress container with Nginx 1.26 & PHP-FPM 8.4 based on Alpine Linux
https://github.com/trafex/docker-wordpress
alpine alpine-linux container containers docker docker-compose docker-wordpress nginx php php8 php8-docker php8-fpm wordpress wordpress-container wp-cli
Last synced: 21 days ago
JSON representation
WordPress container with Nginx 1.26 & PHP-FPM 8.4 based on Alpine Linux
- Host: GitHub
- URL: https://github.com/trafex/docker-wordpress
- Owner: TrafeX
- License: mit
- Created: 2016-08-14T13:46:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-03-23T06:57:07.000Z (about 1 month ago)
- Last Synced: 2025-04-08T11:14:00.239Z (21 days ago)
- Topics: alpine, alpine-linux, container, containers, docker, docker-compose, docker-wordpress, nginx, php, php8, php8-docker, php8-fpm, wordpress, wordpress-container, wp-cli
- Language: Dockerfile
- Homepage: https://hub.docker.com/r/trafex/wordpress/
- Size: 161 KB
- Stars: 277
- Watchers: 16
- Forks: 145
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# WordPress Docker Container
Lightweight WordPress container with Nginx 1.26 & PHP-FPM 8.4 based on Alpine Linux.
_WordPress version currently installed:_ **6.7.2**
* Used in production for many sites, making it stable, tested and up-to-date
* Optimized for 100 concurrent users
* Optimized to only use resources when there's traffic (by using PHP-FPM's ondemand PM)
* Works with Amazon Cloudfront or CloudFlare as SSL terminator and CDN
* Multi-platform, supporting AMD4, ARMv6, ARMv7, ARM64
* Built on the lightweight Alpine Linux distribution
* Small Docker image size (+/-90MB)
* Uses PHP 8.4 for the best performance, low cpu usage & memory footprint
* Can safely be updated without losing data
* Fully configurable because wp-config.php uses the environment variables you can pass as an argument to the container[](https://hub.docker.com/r/trafex/wordpress/)


## [](https://timdepater.com?mtm_campaign=github)
I can help you with [Containerization, Kubernetes, Monitoring, Infrastructure as Code and other DevOps challenges](https://timdepater.com/?mtm_campaign=github).## Usage
See [docker-compose.yml](https://github.com/TrafeX/docker-wordpress/blob/master/docker-compose.yml) how to use it in your own environment.docker-compose up
Or
docker run -d -p 80:80 -v /local/folder:/var/www/wp-content \
-e "DB_HOST=db" \
-e "DB_NAME=wordpress" \
-e "DB_USER=wp" \
-e "DB_PASSWORD=secret" \
-e "FS_METHOD=direct" \
trafex/wordpress### WP-CLI
This image includes [wp-cli](https://wp-cli.org/) which can be used like this:
docker exec /usr/local/bin/wp --path=/usr/src/wordpress
## Inspired by
* https://hub.docker.com/_/wordpress/
* https://codeable.io/wordpress-developers-intro-to-docker-part-two/
* https://github.com/TrafeX/docker-php-nginx/
* https://github.com/etopian/alpine-php-wordpress