该Docker镜像提供WordPress网站的Nginx+PHP部署环境,支持自定义配置、数据持久化与Docker Secrets集成,帮助快速搭建稳定的WordPress站点。
wordpress-php & wordpress-nginx
Wordpress inside Docker.
Project
https://github.com/D3strukt0r/docker-wordpress/blob/master/LICENSE.txt https://hub.docker.com/repository/docker/d3strukt0r/wordpress-nginx https://hub.docker.com/repository/docker/d3strukt0r/wordpress-nginx https://hub.docker.com/repository/docker/d3strukt0r/wordpress-php https://hub.docker.com/repository/docker/d3strukt0r/wordpress-php
master-branch (alias stable, latest)
https://github.com/D3strukt0r/docker-wordpress/actions https://www.codacy.com/manual/D3strukt0r/docker-wordpress
Getting Started
These instructions will cover usage information and for the docker container
Prerequisities
In order to run this container you'll need docker installed.
- https://docs.docker.com/docker-for-windows/install/
- https://docs.docker.com/docker-for-mac/install/
- https://docs.docker.com/install/linux/docker-ce/ubuntu/
Usage
Container Parameters
shelldocker run \ -v $PWD/uploads:/app/wp-content/uploads -e DB_PASSWORD=password -e <all the keys> d3strukt0r/wordpress-php
shelldocker run \ -p 80:80 -v $PWD/uploads:/app/wp-content/uploads d3strukt0r/wordpress-nginx
Environment Variables
All environment variables support Docker Secrets. To learn more about Docker Secrets, read https://docs.docker.com/engine/swarm/secrets/.
Basically, after creating a secret, append a _FILE (e. g. DB_PASSWORD_FILE) after the environment variable and set the path to something like /run/secrets/<something>.
PHP Envs
PHP settings
PHP_MAX_EXECUTION_TIME- The maximum time php can run per request (Default:100M)PHP_MEMORY_LIMIT- The memory limit that php can use (Default:256M)PHP_POST_MAX_SIZE- The maximum size for sending POST requests (maximum upload size) (has to be the same on nginx) (Default:100M)PHP_UPLOAD_MAX_FILESIZE- The maximum size per file for uploading (Default:100M)
Database settings
DB_HOST- Host of the DBMS (Default:db)DB_PORT- Port of the DBMS (Default:3306)DB_USER- The username to use in the DBMS (Default:root)DB_PASSWORD- The password to use in the DBMS (Default: ) (Required)DB_NAME- The database name in the DBMS (Default:wordpress)DB_CHARSET- The character set to use in the DBMS (Default:utf8mb4)DB_COLLATE- The collation to use in the DBMS (Default:utf8mb4_unicode_ci)DB_TABLE_PREFIX- The table prefix to use in the DBMS (Default:wp_) (Hint: Cannot be empty)
Wordpress secrets
WP_AUTH_KEY- Key (Default: ) (Required)WP_SECURE_AUTH_KEY- Key (Default: ) (Required)WP_LOGGED_IN_KEY- Key (Default: ) (Required)WP_NONCE_KEY- Key (Default: ) (Required)WP_AUTH_SALT- Salt (Default: ) (Required)WP_SECURE_AUTH_SALT- Salt (Default: ) (Required)WP_LOGGED_IN_SALT- Salt (Default: ) (Required)WP_NONCE_SALT- Salt (Default: ) (Required)
Other wordpress settings
WP_DEBUG- Whether to enable debug mode (Default:false)
Nginx Envs
NGINX_CLIENT_MAX_BODY_SIZE- The maximum size for sending POST requests (maximum upload size) (has to be the same on php) (Default:100M)USE_HTTPS- Enables https. (Not recommeded, rather use Traefik) (Default:false)
Volumes
/app- All the data/app/wp-config.php- Will use default wp-confing.php or the one on /data if provided/app/wp-content/- Contains plugins, themes, uploads, etc./app/wp-content/uploads- Contains all user uploads (Recommended to connect)
Useful File Locations
PHP Files
/usr/local/bin/wp-plugin-install- Installs a plugin from wordpress in the current directory/usr/local/bin/wp-theme-install- Installs a theme from wordpress in the current directory
Built With
- https://wordpress.org/ - The main software
- https://github.com/features/actions - Automatic CI (Testing) / CD (Deployment)
- https://www.docker.com/ - Building a Container for the Server
Find Us
- https://github.com/D3strukt0r/docker-wordpress
- https://hub.docker.com/r/d3strukt0r/wordpress
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Versioning
There is no versioning in this project. Only the develop for nightly builds, and the master branch which builds latest and all minecraft versions.
Authors
- Manuele Vaccari - https://github.com/D3strukt0r - Initial work
See also the list of https://github.com/D3strukt0r/docker-wordpress/contributors who participated in this project.
License
This project is licensed under the GNU General Public License v3.0 - see the LICENSE.txt file for details.
Acknowledgments
- Hat tip to anyone whose code was used
- Inspiration
- etc
镜像拉取方式
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
轩辕镜像加速拉取命令点我查看更多 wordpress-nginx 镜像标签
DockerHub 原生拉取命令
用户好评
来自真实用户的反馈,见证轩辕镜像的优质服务