Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raulr/nginx-wordpress-docker
Docker image with Nginx front-end for WordPress PHP-FPM image.
https://github.com/raulr/nginx-wordpress-docker
Last synced: about 1 month ago
JSON representation
Docker image with Nginx front-end for WordPress PHP-FPM image.
- Host: GitHub
- URL: https://github.com/raulr/nginx-wordpress-docker
- Owner: raulr
- License: mit
- Created: 2015-12-29T18:56:43.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-05-28T12:00:20.000Z (over 1 year ago)
- Last Synced: 2024-06-01T11:33:39.838Z (6 months ago)
- Language: Shell
- Homepage: https://hub.docker.com/r/raulr/nginx-wordpress/
- Size: 9.77 KB
- Stars: 43
- Watchers: 7
- Forks: 32
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-kubernetes - NGNIX WordPress Docker - The official WordPress image has a PHP-FPM variant, but it still needs a web server to handle HTTP requests. This image provides an Nginx server ready to use as a wordpress:fpm front-end. (Tools)
README
The [official WordPress image](https://hub.docker.com/_/wordpress/) has a PHP-FPM variant, but it still needs a web server to handle HTTP requests. This image provides an Nginx server ready to use as a `wordpress:fpm` front-end.
The Nginx configuration in this image is based on the guidelines given by the [Wordpress Codex](https://codex.wordpress.org/Nginx).
### How to Use This Image
$ docker run --name some-nginx --link some-wordpress:wordpress --volumes-from some-wordpress -d -p 8080:80 raulr/nginx-wordpress
#### Environment Variables
* `POST_MAX_SIZE`: Sets max size of post data allowed. Also affects file uploads (defaults to `64m`).
* `BEHIND_PROXY`: Set to `true` if this container is behind a reverse proxy (defaults to `false` unless `VIRTUAL_HOST` environment variable is set).
* `REAL_IP_HEADER`: Defines the request header that will be used to obtain the real client IP when `BEHIND_PROXY` is set to `true` (defaults to `X-Forwarded-For`).
* `REAL_IP_FROM`: Defines trusted addresses to obtain the real client IP when `BEHIND_PROXY` is set to `true` (defaults to `172.16.0.0/12`).
* `WP_CONTAINER_NAME`: Defines your Wordpress (PHP-FPM) container's name aka fastcgi_pass (defaults to `wordpress`).### ... via [`docker-compose`](https://github.com/docker/compose)
Example `docker-compose.yml`:
```yaml
wordpress:
image: wordpress:fpm
links:
- db:mysql
nginx:
image: raulr/nginx-wordpress
links:
- wordpress
volumes_from:
- wordpress
ports:
- "8080:80"
environment:
POST_MAX_SIZE: 128m
db:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: example
```Run `docker-compose up`, wait for it to initialize completely, and visit `http://localhost:8080` or `http://host-ip:8080`.