Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danielwrobert/055364146a859b5127cea1dc385567ff to your computer and use it in GitHub Desktop.
Save danielwrobert/055364146a859b5127cea1dc385567ff to your computer and use it in GitHub Desktop.
A Docker container configuration for WordPress via Docker Compose.
version: '2'
services:
wordpress:
image: wordpress
ports:
- 8888:80
environment:
WORDPRESS_DB_PASSWORD: password
volumes:
# WordPress and Jetpack are checked out from their git repositories
- ./wordpress:/var/www/html/
- ./jetpack:/var/www/html/wp-content/plugins/jetpack/
- ./opcache-recommended.ini:/usr/local/etc/php/conf.d/opcache-recommended.ini
- ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
mysql:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: password
file_uploads = On
memory_limit = 64M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 600
@danielwrobert
Copy link
Author

The docker-compose... file should be renamed to docker-compose.yaml when loading into a project. The volumes can be adjusted on a per-project bases to better fit what you're working on - theme dev, plugin dev, etc.

The uploads.ini file allows for larger upload files than what you get by default.

I'm not exactly sure about what the opcache-recommended.ini file does. As I understand it, it's just an empty file that helps with caching for your local setup. I may need to remove the comment there but I had to add it for it to be saved here (Gists don't allow empty files). I will research this one a bit more and leave another note when I find more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment