Jin's blog

Configure Wordpress and Redis in Docker


The station has been transferred, and the original 4g small device has been transferred to the current 32g single-use top surface. php+redis+mysql), a caddy under external service. All in all´╝îContainerized incense is complete! ­čśÇ

Transfer plan

My transfer plan is very simple, so it’s a problem, and it’s finally on the new equipment.

This job demand blow one down UpdraftPlus-Reward/Recovery This issue has been completed, serious damage, support automatic release of contents to various long-distance service top, comprehensive and unlimited (Amazon S3, Dropbox, Google Cloud hard drive, rackspace, (S) FTP, WebDAV Japanese electronic mail), the calculation is the most powerful data I’ve used in front of me, and the data I’m talking about is true. Fudo Hashihara Retreat

This song is ready to use, it’s just a matter of demand, and it’s ready for the new environment.

Environmental Department

Former corporate department plan: Docker containerization (wordpress official image, redis official image, mysql official image)


  • docker
  • docker-compose

Directly use docker-compose unit immediately, the following content:

version: "3.1"

        image: wordpress
        container_name: wordpress
        restart: always
            # This is the end of the movie
            WORDPRESS_DB_HOST: db
            WORDPRESS_DB_USER: wpuser
            WORDPRESS_DB_PASSWORD: wppassword
            WORDPRESS_DB_NAME: wpdb
            - wordpress:/var/www/html

        image: mysql:5.7
        container_name: wordpress_mysql
        restart: always
            MYSQL_DATABASE: wpdb
            MYSQL_USER: wpuser
            MYSQL_PASSWORD: wppassword
        volumes: -wp_db:/var/lib/mysql

        image: redis
        container_name: wordpress_redis
        restart: always


Use the following commands

docker-compose -p wp up -d

After the execution is completed, it will be placed on the opposite side of the agent.

My web apparel use caddy, specific combination possible, please refer to my previous text, this layout format is as follows:

https://jinzh.me {
         tls [email protected]
# Arrangement mail box
#Placement anti-replacement site
         encode gzip

After that, deploy wordpress redis, redis uplink department completed, but not include wordpress image php redsi exhibition, and update wordpress redis information

For this reason, in the advanced container:

docker exec -it wordpress bash
#wordpress is container name

Wordpress container package management usage is apt, first update:

apt update
apt install vim
# Anso vim
pecl install redis-5.1.1
# Pass through pecl and redis redis
docker-php-ext-enable redis
# Opening Exhibition

Add the following contents to wp-config.php:

define("WP_REDIS_HOST","redis");//Main machine name (docker container name)
# Other parameters Reference: https://github.com/rhubarbgroup/redis-cache/wiki/Connection-Parameters

The deployment is complete, and the wp has been opened (recommended Redis Object Cache).