Created
September 30, 2022 15:04
-
-
Save jrltt/64bb843d33cdc375a86eefc6eb66d78f to your computer and use it in GitHub Desktop.
Docker compose (Wordpress & phpMyAdmin)
This file contains hidden or 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.3' | |
| services: | |
| db: | |
| container_name: 'local-wordpress-db' | |
| image: 'mysql:5.7' | |
| volumes: | |
| - './data/mysql:/var/lib/mysql' | |
| ports: | |
| - 18766:3306 | |
| environment: | |
| MYSQL_ROOT_PASSWORD: databasepassword | |
| MYSQL_DATABASE: wordpress_db | |
| MYSQL_USER: wordpress_user | |
| MYSQL_PASSWORD: wordpress_password | |
| phpmyadmin: | |
| image: phpmyadmin | |
| container_name: 'local-wordpress-pma' | |
| links: | |
| - db | |
| environment: | |
| PMA_HOST: db | |
| PMA_PORT: 3306 | |
| PMA_ARBITRARY: 1 | |
| MYSQL_ROOT_PASSWORD: databasepassword | |
| # Set upload limit for import huge DB | |
| # UPLOAD_LIMIT: 128M | |
| restart: always | |
| ports: | |
| - 8081:80 | |
| wordpress: | |
| container_name: 'local-wordpress' | |
| depends_on: | |
| - db | |
| # Choose wordpress image | |
| # image: 'wordpress:4.6.1-php5.6-apache' | |
| # image: 'wordpress:6.0.2-php7.4-apache' | |
| image: 'wordpress:6.0.2-php8.1-apache' | |
| ports: | |
| - '8080:80' | |
| environment: | |
| WORDPRESS_DB_HOST: 'db:3306' | |
| WORDPRESS_DB_USER: root | |
| WORDPRESS_DB_PASSWORD: databasepassword | |
| WORDPRESS_DB_NAME: databasename | |
| volumes: | |
| - "./wordpress:/var/www/html" | |
| - "./plugins:/var/www/html/wp-content/plugins" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to see errors on the docker image from Wordpress?
docker ps -adocker logs -f CONTAINER_ID 2>&1 >/dev/null | grep -i error