Created
March 11, 2021 16:19
-
-
Save jonshipman/3847944dd0a8b083c776e6f061d2bda9 to your computer and use it in GitHub Desktop.
WordPress Docker-compose
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.7' | |
services: | |
db: | |
image: mariadb:10.1.41 | |
restart: always | |
environment: | |
MYSQL_DATABASE: WORDPRESS | |
MYSQL_USER: WORDPRESS | |
MYSQL_PASSWORD: WORDPRESS | |
MYSQL_ROOT_PASSWORD: WORDPRESS | |
volumes: | |
- wordpress_db:/var/lib/mysql | |
- ./db:/docker-entrypoint-initdb.d | |
wordpress: | |
container_name: wp-${PROJECT} | |
image: wordpress:latest | |
restart: always | |
ports: | |
- '8000:80' | |
environment: | |
WORDPRESS_DB_HOST: db:3306 | |
WORDPRESS_DB_USER: WORDPRESS | |
WORDPRESS_DB_PASSWORD: WORDPRESS | |
WORDPRESS_DB_NAME: WORDPRESS | |
WORDPRESS_TABLE_PREFIX: 98Hjdh_ | |
WORDPRESS_DEBUG: 1 | |
VIRTUAL_PORT: 8000 | |
HOME: /tmp | |
volumes: | |
- ./wp-content:/var/www/html/wp-content | |
entrypoint: [ "/bin/sh", "-c" ] | |
command: > | |
' | |
usermod -u 1000 www-data | |
groupmod -g 1000 www-data | |
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
chmod +x wp-cli.phar | |
mv wp-cli.phar /usr/local/bin/wp | |
docker-entrypoint.sh apache2-foreground | |
' | |
depends_on: | |
- db | |
phpmyadmin: | |
restart: always | |
image: phpmyadmin/phpmyadmin | |
ports: | |
- "8580:80" | |
environment: | |
PMA_HOST: db:3306 | |
PMA_USER: WORDPRESS | |
PMA_PASSWORD: WORDPRESS | |
links: | |
- db | |
volumes: | |
wordpress_db: | |
name: db_data_${PROJECT} | |
external: false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment