项目作者: GrottoPress

项目描述 :
WordPress docker image, batteries included.
高级语言: Dockerfile
项目地址: git://github.com/GrottoPress/docker-wordpress.git
创建时间: 2018-12-14T13:57:46Z
项目社区:https://github.com/GrottoPress/docker-wordpress

开源协议:MIT License

下载


WordPress Docker Image

WordPress, batteries included. Adds the following PHP extensions:

  • imagick
  • imap
  • intl
  • redis
  • soap

Usage

Example: docker run -v app:/var/www/html grottopress/wordpress:5.6-php8.0-fpm-alpine

WordPress requires a MySQL database to save data.

Additionally, you may need to run this in tandem with a frontend (eg. nginx), if you use any of the PHP-FPM variants.

Minimal example using docker-compose:

  1. ---
  2. # docker-compose.yml
  3. version: "3.7"
  4. services:
  5. mariadb:
  6. image: mariadb:10.5
  7. restart: always
  8. volumes:
  9. - db:/var/lib/mysql
  10. environment:
  11. MYSQL_ROOT_PASSWORD: db-root-password
  12. MYSQL_DATABASE: wordpress-db-name
  13. MYSQL_USER: wordpress-db-user
  14. MYSQL_PASSWORD: wordpress-db-user-password
  15. networks:
  16. - back
  17. nginx:
  18. image: nginx:1.19-alpine
  19. depends_on:
  20. - wordpress
  21. ports:
  22. - "127.0.0.1:8080:80"
  23. restart: always
  24. volumes:
  25. - app:/var/www/html:ro
  26. - ./wordpress.conf:/etc/nginx/conf.d/wordpress.conf:ro
  27. networks:
  28. - front
  29. wordpress:
  30. image: grottopress/wordpress:5.6-php8.0-fpm-alpine
  31. depends_on:
  32. - mariadb
  33. environment:
  34. WORDPRESS_DB_HOST: mariadb:3306
  35. WORDPRESS_DB_NAME: wordpress-db-name
  36. WORDPRESS_DB_USER: wordpress-db-user
  37. WORDPRESS_DB_PASSWORD: wordpress-db-user-password
  38. restart: always
  39. volumes:
  40. - app:/var/www/html
  41. networks:
  42. - back
  43. - front
  44. networks:
  45. back: {}
  46. front: {}
  47. volumes:
  48. app: {}
  49. db: {}

You should have a wordpress.conf file in the same directory as the docker-compose.yml, with fastcgi_pass wordpress:9000; in its PHP location block(s).

Run docker-compose up -d to start the services.

Need a WordPress development environment?

If using WordPress with docker for development, check out our WordPress Development Environment. It pulls together useful WordPress development tools, via docker-compose, to form a complete WordPress development solution.

Check it out »

Alternatives

If this does not satisfy your specific needs, check out the following images: