Need help with docker-wordpress?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

TrafeX
151 Stars 89 Forks MIT License 96 Commits 6 Opened issues

Description

WordPress container with Nginx 1.18 & PHP-FPM 7.4 based on Alpine Linux

Services available

!
?

Need anything else?

Contributors list

# 31,745
PHP
alpine-...
nginx
WordPre...
74 commits
# 23,907
Laravel
statusp...
python3
weather...
4 commits
# 389,062
nginx
WordPre...
php7
CSS
2 commits
# 392,611
PHP
alpine-...
wp-cli
nginx
2 commits
# 16,773
Elixir
Rails
fish-sh...
Erlang
1 commit
# 480,787
PHP
alpine-...
wp-cli
nginx
1 commit
# 7,004
PHP
wordpre...
bedrock
WordPre...
1 commit

WordPress Docker Container

Lightweight WordPress container with Nginx 1.18 & PHP-FPM 7.4 based on Alpine Linux.

WordPress version currently installed: 5.7

  • Used in production for my own 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)
  • Best to be used with Amazon Cloudfront as SSL terminator and CDN
  • Built on the lightweight Alpine Linux distribution
  • Small Docker image size (+/-50MB)
  • Uses PHP 7.4 for better performance, lower 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

Docker Pulls Docker image layers nginx 1.18 php 7.4 License MIT

Usage

See 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 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

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.