├── .env.example ├── .gitignore ├── LICENSE ├── README.md ├── _config.yml ├── bin ├── backup.sh ├── restore.sh ├── setup.sh ├── wp-cli-test.sh └── wp.sh ├── conf.d └── php.ini ├── docker-compose-local.yml ├── docker-compose.yml └── docs └── README.md /.env.example: -------------------------------------------------------------------------------- 1 | #----------------------------------------------------------------------- 2 | # 3 | # Docker Wordpress .env file 4 | # 5 | # https://github.com/evertramos/docker-wordpress 6 | # 7 | #----------------------------------------------------------------------- 8 | 9 | #----------------------------------------------------------------------- 10 | # 11 | # Compose Project Name 12 | # 13 | # This is one of the variables available in Docker Compose command-line 14 | # It will be used for naming conventions the containers, network and 15 | # some other service. Check the refence below for more information: 16 | # 17 | # https://docs.docker.com/compose/reference/envvars/#compose_project_name 18 | # 19 | COMPOSE_PROJECT_NAME=docker-wordpress-compose-project-name 20 | 21 | #----------------------------------------------------------------------- 22 | # 23 | # NGINX Proxy options 24 | # 25 | # Here you may set NGINX Proxy options, the network must match the proxy 26 | # network, the domain name which will be used by the NGINX and issue 27 | # the tls certificate by the Lets Encrypt, and the required email 28 | # 29 | DOCKER_WORDPRESS_NETWORK=proxy 30 | 31 | # Your domain (or domains) 32 | DOCKER_WORDPRESS_DOMAINS=domain.com,www.domain.com 33 | 34 | # Your email for Let's Encrypt register 35 | DOCKER_WORDPRESS_LETSENCRYPT_EMAIL=your_email@domain.com 36 | 37 | #----------------------------------------------------------------------- 38 | # 39 | # Database container options 40 | # 41 | # WordPress offers by default MySQL or MariaDB as database, make sure to set 42 | # the image version when using this project, once it will be required when 43 | # restoring your site from a backup file or even when cloning your site 44 | # 45 | 46 | # DB container name 47 | DOCKER_WORDPRESS_DB_CONTAINER_NAME=docker-wordpress-compose-project-name-db 48 | 49 | # Database image (mariadb|mysql) 50 | DOCKER_WORDPRESS_DB_IMAGE=mysql 51 | 52 | # Database version 53 | DOCKER_WORDPRESS_DB_VERSION=lts 54 | 55 | # Path to store your database files 56 | DOCKER_WORDPRESS_DB_FILES=./data/db 57 | 58 | # Root password for your database 59 | DOCKER_WORDPRESS_MYSQL_ROOT_PASSWORD=root_password 60 | 61 | # Database name, user and password for your wordpress 62 | DOCKER_WORDPRESS_MYSQL_DATABASE=database_name 63 | DOCKER_WORDPRESS_MYSQL_USER=user_name 64 | DOCKER_WORDPRESS_MYSQL_PASSWORD=user_password 65 | 66 | #----------------------------------------------------------------------- 67 | # 68 | # Wordpress container options 69 | # 70 | # Here you set the WordPress image and version you want to use for your project 71 | # if you have local image you can use it here as well, just make sure to set 72 | # the image version to make sure compatibility when restoring your site 73 | # 74 | 75 | # Site container name 76 | DOCKER_WORDPRESS_SITE_CONTAINER_NAME=docker-wordpress-compose-project-name-site 77 | 78 | # Site Image (wordpress) 79 | DOCKER_WORDPRESS_SITE_IMAGE=wordpress 80 | 81 | # Site Version 82 | DOCKER_WORDPRESS_SITE_VERSION=latest 83 | 84 | # Path to store your site files 85 | DOCKER_WORDPRESS_SITE_FILES=./data/site 86 | 87 | # Table prefix 88 | DOCKER_WORDPRESS_TABLE_PREFIX=wp_ 89 | 90 | #----------------------------------------------------------------------- 91 | # 92 | # Resources limit 93 | # 94 | # Here you can limit the memory usage and cpu for your containers, separately, 95 | # site and database, the values below is the least expected to run a small 96 | # WordPress site, and it's database, make sure you keep a watch on that 97 | # 98 | 99 | # Site container CPU limit 100 | DOCKER_WORDPRESS_SITE_CPU_LIMIT='0.5' 101 | 102 | # Site container Memory limit 103 | DOCKER_WORDPRESS_SITE_MEMORY_LIMIT=300M 104 | 105 | # Database container CPU limit 106 | DOCKER_WORDPRESS_MYSQL_CPU_LIMIT='0.5' 107 | 108 | # Database container Memory limit 109 | DOCKER_WORDPRESS_MYSQL_MEMORY_LIMIT=300M 110 | 111 | #----------------------------------------------------------------------- 112 | # 113 | # Logging options 114 | # 115 | # Please make sure to use this option carefuly, you may need to have some 116 | # log to audit but you might end up to use a lot of disk space if you 117 | # don't limit the maximum file size and the maximum mnumber of files 118 | # 119 | DOCKER_WORDPRESS_SITE_LOG_DRIVER=json-file 120 | DOCKER_WORDPRESS_SITE_LOG_MAX_SIZE=800k 121 | DOCKER_WORDPRESS_SITE_LOG_MAX_FILE=10 122 | 123 | DOCKER_WORDPRESS_DB_LOG_DRIVER=json-file 124 | DOCKER_WORDPRESS_DB_LOG_MAX_SIZE=200k 125 | DOCKER_WORDPRESS_DB_LOG_MAX_FILE=10 126 | 127 | #----------------------------------------------------------------------- 128 | # 129 | # Server Automation options 130 | # 131 | # The otions below are used by the script Server Automation to replace 132 | # the strings in docker-compose file and .env file. If you are not 133 | # using the script you may ignore it of delete these options 134 | # 135 | REPLACE_DB_SERVICE_NAME=docker-wordpress-new-db 136 | REPLACE_SITE_SERVICE_NAME=docker-wordpress-new-site 137 | REPLACE_PROXY_NETWORK_NAME=docker-wordpress-proxy-network 138 | 139 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | data 3 | .idea 4 | /backups -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Evert Ramos 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker Wordpress 🚀 2 | 3 |

4 | 5 | 6 |

7 | 8 | ![wordpress-docker-letsencrypt](https://github.com/evertramos/images/raw/master/wordpress.jpg) 9 | 10 | 11 | ## How to start 🔰 12 | 13 | This script was first designed to work along with [**Server Automation**](https://github.com/evertramos/server-automation), 14 | where you will be able to start a new WordPress site in less than a minute. 15 | 16 | ### Developing locally 17 | 18 | If you want to run this project locally, you can do it by running the following command: 19 | 20 | ```bash 21 | git clone https://github.com/evertramos/docker-wordpress.git 22 | cd docker-wordpress 23 | ./bin/setup.sh 24 | ``` 25 | 26 | This will start the containers and create a new database for you. 27 | 28 | ### Migrating from local to production 29 | 30 | If you want to migrate your local site (wordpress files and database) to production, 31 | you can do it by running the following command: 32 | 33 | :construction: Work in progress 34 | 35 | ## Known Issues 💭 36 | 37 | ### 1. Azure 38 | 39 | Running docker on Azure servers you must mount your database in your disks partitions (example: `/mnt/data/`) 40 | so your db container can work. 41 | 42 | > This is a some kind of issue regarding Hyper-V sharing drivers... not really sure why. If you know what the issue id, 43 | > please, open an issue on GitHub and I will be glad to update this documentation. 44 | 45 | --- 46 | 47 | ## Versions 48 | 49 | The versioning of this project matches the same tag of 50 | [Server Automation](https://github.com/evertramos/server-automation) and 51 | [NGINX proxy automation](https://github.com/evertramos/nginx-proxy-automation). 52 | 53 | Table of compatibility: 54 | 55 | docker-wordpress | nginx-proxy-automation | server-automation 56 | :---: | :---: | :---: 57 | v0.5 | v0.5 | v0.5 58 | 59 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-architect -------------------------------------------------------------------------------- /bin/backup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Backup script for local development environment..." 4 | 5 | # Get the script name and its file real path 6 | SCRIPT_PATH="$(dirname "$(readlink -f "$0")")" 7 | 8 | BACKUP_DESTINATION="${SCRIPT_PATH}/../backups" 9 | WORDPRESS_DB_NAME=wordpress 10 | DOCKER_WORDPRESS_MYSQL_ROOT_PASSWORD=root 11 | 12 | # Check if all services are running 13 | if ! docker compose -f "${SCRIPT_PATH}/../docker-compose-local.yml" ps | grep -q "Up"; then 14 | echo "Not all services are running. Please start the services and try again." 15 | exit 1 16 | fi 17 | 18 | # Create backup destination if directory does not exist 19 | mkdir -p "${BACKUP_DESTINATION}" 20 | 21 | # Backup the database 22 | docker compose -f "${SCRIPT_PATH}/../docker-compose-local.yml" exec -T mysql-db \ 23 | mysqldump -u root -p"${DOCKER_WORDPRESS_MYSQL_ROOT_PASSWORD}" "${WORDPRESS_DB_NAME}" > "${BACKUP_DESTINATION}/db_backup.sql" 24 | 25 | # Backup the WordPress files 26 | docker compose -f "${SCRIPT_PATH}/../docker-compose-local.yml" exec wordpress-site sh -c \ 27 | "tar -C /var/www/html -vczf /tmp/wordpress-backup.tar.gz wp-content wp-config.php" 28 | docker compose -f "${SCRIPT_PATH}/../docker-compose-local.yml" cp wordpress-site:/tmp/wordpress-backup.tar.gz "${BACKUP_DESTINATION}/" 29 | docker compose -f "${SCRIPT_PATH}/../docker-compose-local.yml" exec wordpress-site rm /tmp/wordpress-backup.tar.gz 30 | 31 | 32 | exit 0 33 | -------------------------------------------------------------------------------- /bin/restore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Restore script for local development environment..." 4 | 5 | # Get the script name and its file real path 6 | SCRIPT_PATH="$(dirname "$(readlink -f "$0")")" 7 | 8 | BACKUP_SOURCE="${SCRIPT_PATH}/../backups" 9 | WORDPRESS_DB_NAME=wordpress 10 | DOCKER_WORDPRESS_MYSQL_ROOT_PASSWORD=root 11 | 12 | # Check if all services are running 13 | if ! docker compose -f "${SCRIPT_PATH}/../docker-compose-local.yml" ps | grep -q "Up"; then 14 | echo "Not all services are running. Please start the services and try again." 15 | exit 1 16 | fi 17 | 18 | # Restore the database 19 | docker compose -f "${SCRIPT_PATH}/../docker-compose-local.yml" exec -T mysql-db \ 20 | mysql -u root -p"${DOCKER_WORDPRESS_MYSQL_ROOT_PASSWORD}" "${WORDPRESS_DB_NAME}" < "${BACKUP_SOURCE}/db_backup.sql" 21 | 22 | # Restore the WordPress files 23 | docker compose -f "${SCRIPT_PATH}/../docker-compose-local.yml" cp "${BACKUP_SOURCE}/wordpress-backup.tar.gz" wordpress-site:/tmp/ 24 | docker compose -f "${SCRIPT_PATH}/../docker-compose-local.yml" exec wordpress-site sh -c \ 25 | "tar -xzf /tmp/wordpress-backup.tar.gz -C /var/www/html && rm /tmp/wordpress-backup.tar.gz" 26 | 27 | exit 0 28 | 29 | -------------------------------------------------------------------------------- /bin/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Running setup.sh for local development environment..." 4 | 5 | COMMAND=${1:-"up"} 6 | 7 | # Get the script name and its file real path 8 | SCRIPT_PATH="$(dirname "$(readlink -f "$0")")" 9 | 10 | # Check if Docker is running 11 | if ! docker info > /dev/null 2>&1; then 12 | echo "Docker is not running. Please start Docker and try again." 13 | exit 1 14 | fi 15 | 16 | # Check if Docker Compose is installed 17 | if ! command -v docker compose &> /dev/null; then 18 | echo "Docker Compose is not installed. Please install Docker Compose and try again." 19 | exit 1 20 | fi 21 | 22 | # Check if the Docker Compose file exists 23 | if [ ! -f "${SCRIPT_PATH}/../docker-compose-local.yml" ]; then 24 | echo "docker-compose-local.yml file not found. Please ensure you are in the correct directory." 25 | exit 1 26 | fi 27 | 28 | # Check if the .env file exists 29 | #if [ ! -f .env ]; then 30 | # echo ".env file not found. Please create a .env file with the necessary environment variables." 31 | # exit 1 32 | #fi 33 | 34 | # Run the Docker Compose command 35 | if [ "$COMMAND" != "up" ]; then 36 | docker compose -f "${SCRIPT_PATH}/../docker-compose-local.yml" "${COMMAND}" 37 | exit 0 38 | fi 39 | 40 | # Start the Docker containers 41 | docker compose -f "${SCRIPT_PATH}/../docker-compose-local.yml" up -d 42 | 43 | 44 | exit 0 45 | -------------------------------------------------------------------------------- /bin/wp-cli-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | alias wp="docker-compose run --rm wpcli" 4 | 5 | wp --info 6 | 7 | exit 0 8 | -------------------------------------------------------------------------------- /bin/wp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker-compose run --user 33:33 --rm wpcli 4 | 5 | # 33:33 for ubuntu 6 | 7 | -------------------------------------------------------------------------------- /conf.d/php.ini: -------------------------------------------------------------------------------- 1 | file_uploads=On 2 | memory_limit=512M 3 | upload_max_filesize=100M 4 | post_max_size=100M 5 | max_execution_time=600 6 | expose_php=Off 7 | ;date.timezone=UTC 8 | 9 | ; Otimizar Imagick se disponível 10 | imagick.resource_limits.threads = 4 11 | imagick.resource_limits.memory = 512 12 | imagick.resource_limits.map = 512 13 | 14 | pm = dynamic 15 | pm.max_children = 12 16 | pm.start_servers = 6 17 | pm.min_spare_servers = 6 18 | pm.max_spare_servers = 8 19 | -------------------------------------------------------------------------------- /docker-compose-local.yml: -------------------------------------------------------------------------------- 1 | services: 2 | mysql-db: 3 | image: ${DOCKER_WORDPRESS_DB_IMAGE:-mysql}:${DOCKER_WORDPRESS_DB_VERSION:-lts} 4 | container_name: ${DOCKER_WORDPRESS_DB_CONTAINER_NAME:-mysql} 5 | ports: 6 | - "3306:3306" 7 | volumes: 8 | - docker-wordpress-db-files:/var/lib/mysql 9 | environment: 10 | MYSQL_ROOT_PASSWORD: ${DOCKER_WORDPRESS_MYSQL_ROOT_PASSWORD:-root} 11 | MYSQL_DATABASE: ${DOCKER_WORDPRESS_MYSQL_DATABASE:-wordpress} 12 | MYSQL_USER: ${DOCKER_WORDPRESS_MYSQL_USER:-wordpress} 13 | MYSQL_PASSWORD: ${DOCKER_WORDPRESS_MYSQL_PASSWORD:-wordpress} 14 | 15 | wordpress-site: 16 | depends_on: 17 | - mysql-db 18 | image: ${DOCKER_WORDPRESS_SITE_IMAGE:-wordpress}:${DOCKER_WORDPRESS_SITE_VERSION:-latest} 19 | container_name: ${DOCKER_WORDPRESS_SITE_CONTAINER_NAME:-wordpress} 20 | ports: 21 | - "8080:80" 22 | volumes: 23 | - docker-wordpress-site-files:/var/www/html 24 | - ./conf.d/php.ini:/usr/local/etc/php/conf.d/php.ini 25 | environment: 26 | WORDPRESS_DB_HOST: ${DOCKER_WORDPRESS_DB_HOST:-mysql-db}:3306 27 | WORDPRESS_DB_NAME: ${DOCKER_WORDPRESS_MYSQL_DATABASE:-wordpress} 28 | WORDPRESS_DB_USER: ${DOCKER_WORDPRESS_MYSQL_USER:-wordpress} 29 | WORDPRESS_DB_PASSWORD: ${DOCKER_WORDPRESS_MYSQL_PASSWORD:-wordpress} 30 | # WORDPRESS_TABLE_PREFIX: ${DOCKER_WORDPRESS_TABLE_PREFIX} 31 | # WORDPRESS_AUTH_KEY: ${DOCKER_WORDPRESS_AUTH_KEY:-null} 32 | # WORDPRESS_SECURE_AUTH_KEY: ${DOCKER_WORDPRESS_SECURE_AUTH_KEY:-null} 33 | # WORDPRESS_LOGGED_IN_KEY: ${DOCKER_WORDPRESS_LOGGED_IN_KEY:-null} 34 | # WORDPRESS_NONCE_KEY: ${DOCKER_WORDPRESS_NONCE_KEY:-null} 35 | # WORDPRESS_AUTH_SALT: ${DOCKER_WORDPRESS_AUTH_SALT:-null} 36 | # WORDPRESS_SECURE_AUTH_SALT: ${DOCKER_WORDPRESS_SECURE_AUTH_SALT:-null} 37 | # WORDPRESS_LOGGED_IN_SALT: ${DOCKER_WORDPRESS_LOGGED_IN_SALT:-null} 38 | # WORDPRESS_NONCE_SALT: ${DOCKER_WORDPRESS_NONCE_SALT:-null} 39 | # WORDPRESS_DEBUG: ${DOCKER_WORDPRESS_DEBUG:-null} 40 | # WORDPRESS_CONFIG_EXTRA: ${DOCKER_WORDPRESS_CONFIG_EXTRA:-null} 41 | 42 | wpcli: 43 | image: wordpress:cli 44 | user: 33:33 45 | environment: 46 | WORDPRESS_DB_HOST: ${DOCKER_WORDPRESS_DB_HOST:-mysql-db}:3306 47 | WORDPRESS_DB_NAME: ${DOCKER_WORDPRESS_MYSQL_DATABASE:-wordpress} 48 | WORDPRESS_DB_USER: ${DOCKER_WORDPRESS_MYSQL_USER:-wordpress} 49 | WORDPRESS_DB_PASSWORD: ${DOCKER_WORDPRESS_MYSQL_PASSWORD:-wordpress} 50 | # WORDPRESS_TABLE_PREFIX: ${DOCKER_WORDPRESS_TABLE_PREFIX} 51 | volumes: 52 | - docker-wordpress-site-files:/var/www/html 53 | depends_on: 54 | - mysql-db 55 | entrypoint: wp 56 | 57 | volumes: 58 | docker-wordpress-db-files: 59 | driver: local 60 | docker-wordpress-site-files: 61 | driver: local 62 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | docker-wordpress-new-db: 3 | image: ${DOCKER_WORDPRESS_DB_IMAGE:-mysql}:${DOCKER_WORDPRESS_DB_VERSION:-lts} 4 | container_name: ${DOCKER_WORDPRESS_DB_CONTAINER_NAME} 5 | restart: unless-stopped 6 | deploy: 7 | resources: 8 | limits: 9 | cpus: ${DOCKER_WORDPRESS_MYSQL_CPU_LIMIT:-'0.5'} 10 | memory: ${DOCKER_WORDPRESS_MYSQL_MEMORY_LIMIT:-300M} 11 | networks: 12 | - docker-wordpress-db-net 13 | volumes: 14 | - ${DOCKER_WORDPRESS_DB_FILES}:/var/lib/mysql 15 | environment: 16 | MYSQL_ROOT_PASSWORD: ${DOCKER_WORDPRESS_MYSQL_ROOT_PASSWORD} 17 | MYSQL_DATABASE: ${DOCKER_WORDPRESS_MYSQL_DATABASE} 18 | MYSQL_USER: ${DOCKER_WORDPRESS_MYSQL_USER} 19 | MYSQL_PASSWORD: ${DOCKER_WORDPRESS_MYSQL_PASSWORD} 20 | logging: 21 | driver: ${DOCKER_WORDPRESS_DB_LOG_DRIVER:-json-file} 22 | options: 23 | max-size: ${DOCKER_WORDPRESS_DB_LOG_MAX_SIZE:-1m} 24 | max-file: ${DOCKER_WORDPRESS_DB_LOG_MAX_FILE:-10} 25 | 26 | 27 | docker-wordpress-new-site: 28 | depends_on: 29 | - docker-wordpress-new-db 30 | image: ${DOCKER_WORDPRESS_SITE_IMAGE:-wordpress}:${DOCKER_WORDPRESS_SITE_VERSION:-latest} 31 | container_name: ${DOCKER_WORDPRESS_SITE_CONTAINER_NAME} 32 | restart: unless-stopped 33 | deploy: 34 | resources: 35 | limits: 36 | cpus: ${DOCKER_WORDPRESS_SITE_CPU_LIMIT:-'0.5'} 37 | memory: ${DOCKER_WORDPRESS_SITE_MEMORY_LIMIT:-300M} 38 | networks: 39 | - docker-wordpress-proxy-network 40 | - docker-wordpress-db-net 41 | volumes: 42 | - ${DOCKER_WORDPRESS_SITE_FILES}:/var/www/html 43 | - ./conf.d/php.ini:/usr/local/etc/php/conf.d/php.ini 44 | environment: 45 | WORDPRESS_DB_HOST: ${DOCKER_WORDPRESS_DB_HOST:-docker-wordpress-new-db}:3306 46 | WORDPRESS_DB_NAME: ${DOCKER_WORDPRESS_MYSQL_DATABASE} 47 | WORDPRESS_DB_USER: ${DOCKER_WORDPRESS_MYSQL_USER} 48 | WORDPRESS_DB_PASSWORD: ${DOCKER_WORDPRESS_MYSQL_PASSWORD} 49 | WORDPRESS_TABLE_PREFIX: ${DOCKER_WORDPRESS_TABLE_PREFIX} 50 | VIRTUAL_HOST: ${DOCKER_WORDPRESS_DOMAINS} 51 | # VIRTUAL_PATH: ${DOCKER_WORDPRESS_VIRTUAL_PATH:-"/"} 52 | # VIRTUAL_DEST: ${DOCKER_WORDPRESS_VIRTUAL_DEST:-"/"} 53 | LETSENCRYPT_HOST: ${DOCKER_WORDPRESS_DOMAINS} 54 | LETSENCRYPT_EMAIL: ${DOCKER_WORDPRESS_LETSENCRYPT_EMAIL} 55 | # WORDPRESS_AUTH_KEY: ${DOCKER_WORDPRESS_AUTH_KEY:-null} 56 | # WORDPRESS_SECURE_AUTH_KEY: ${DOCKER_WORDPRESS_SECURE_AUTH_KEY:-null} 57 | # WORDPRESS_LOGGED_IN_KEY: ${DOCKER_WORDPRESS_LOGGED_IN_KEY:-null} 58 | # WORDPRESS_NONCE_KEY: ${DOCKER_WORDPRESS_NONCE_KEY:-null} 59 | # WORDPRESS_AUTH_SALT: ${DOCKER_WORDPRESS_AUTH_SALT:-null} 60 | # WORDPRESS_SECURE_AUTH_SALT: ${DOCKER_WORDPRESS_SECURE_AUTH_SALT:-null} 61 | # WORDPRESS_LOGGED_IN_SALT: ${DOCKER_WORDPRESS_LOGGED_IN_SALT:-null} 62 | # WORDPRESS_NONCE_SALT: ${DOCKER_WORDPRESS_NONCE_SALT:-null} 63 | # WORDPRESS_DEBUG: ${DOCKER_WORDPRESS_DEBUG:-null} 64 | # WORDPRESS_CONFIG_EXTRA: ${DOCKER_WORDPRESS_CONFIG_EXTRA:-null} 65 | logging: 66 | driver: ${DOCKER_WORDPRESS_SITE_LOG_DRIVER:-json-file} 67 | options: 68 | max-size: ${DOCKER_WORDPRESS_SITE_LOG_MAX_SIZE:-2m} 69 | max-file: ${DOCKER_WORDPRESS_SITE_LOG_MAX_FILE:-10} 70 | 71 | wpcli: 72 | image: wordpress:cli 73 | user: 33:33 74 | environment: 75 | WORDPRESS_DB_HOST: ${DOCKER_WORDPRESS_DB_HOST:-docker-wordpress-new-db}:3306 76 | WORDPRESS_DB_NAME: ${DOCKER_WORDPRESS_MYSQL_DATABASE} 77 | WORDPRESS_DB_USER: ${DOCKER_WORDPRESS_MYSQL_USER} 78 | WORDPRESS_DB_PASSWORD: ${DOCKER_WORDPRESS_MYSQL_PASSWORD} 79 | WORDPRESS_TABLE_PREFIX: ${DOCKER_WORDPRESS_TABLE_PREFIX} 80 | networks: 81 | - docker-wordpress-db-net 82 | volumes: 83 | - ${DOCKER_WORDPRESS_SITE_FILES}:/var/www/html 84 | depends_on: 85 | - docker-wordpress-new-db 86 | entrypoint: wp 87 | 88 | networks: 89 | docker-wordpress-proxy-network: 90 | external: true 91 | docker-wordpress-db-net: 92 | 93 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Docker WordPres --------------------------------------------------------------------------------