Last active
April 27, 2019 13:32
-
-
Save shanebp/f9e40136e8660c8fed8acab50d54a6c2 to your computer and use it in GitHub Desktop.
docker compose WordPress linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
db: | |
image: mysql:5.7 | |
volumes: | |
- db_data:/var/lib/mysql | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: wordpress | |
MYSQL_DATABASE: wordpress | |
MYSQL_USER: wordpress | |
MYSQL_PASSWORD: wordpress | |
wordpress: | |
depends_on: | |
- db | |
image: wordpress:5.1.1-php7.3-apache | |
ports: | |
- "9210:80" | |
restart: always | |
environment: | |
WORDPRESS_DB_HOST: db:3306 | |
WORDPRESS_DB_USER: wordpress | |
WORDPRESS_DB_PASSWORD: wordpress | |
working_dir: /var/www/html | |
volumes: | |
- ~/wordpress/wp_html:/var/www/html | |
- ~/wordpress/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini | |
phpmyadmin: | |
image: corbinu/docker-phpmyadmin | |
links: | |
- db:mysql | |
ports: | |
- 9211:80 | |
environment: | |
MYSQL_USERNAME: wordpress | |
MYSQL_ROOT_PASSWORD: wordpress | |
MYSQL_PORT_3306_TCP_ADDR: db | |
mailhog: | |
image: mailhog/mailhog | |
ports: | |
- 1025:1025 # smtp server | |
- 8025:8025 # web ui | |
volumes: | |
db_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* put in your theme/functions file | |
* or in plugins/bp-custom.php if you are using BuddyPress | |
*/ | |
function mailhog_setup( PHPMailer $phpmailer ) { | |
$phpmailer->Host = 'mailhog'; | |
$phpmailer->Port = 1025; | |
$phpmailer->IsSMTP(); | |
} | |
add_action( 'phpmailer_init', 'mailhog_setup' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fileuploads = On | |
memory_limit = 64M | |
upload_max_filesize = 64M | |
post_max_size = 64M | |
max_execution_time = 600 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sudo docker-compose up -d
sudo docker-compose down
Put
uploads.ini
in~/wordpress/
The first time you create this container and any time you wipe the volumes, you may need to comment out this line:
# - ~/wordpress/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
Because the directory won't exist yet.
Then delete the container, move the file to the directory and restart the container.