├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── config └── php.conf.ini ├── docker-compose.yml └── env.example /.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | wp-app 3 | wp-data 4 | .idea -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2023 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. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ROOT_DIR = $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) 2 | 3 | APP_NAME = Wordpress Docker 4 | 5 | SHELL ?= /bin/bash 6 | 7 | .SILENT: ; # no need for @ 8 | .ONESHELL: ; # recipes execute in same shell 9 | .NOTPARALLEL: ; # wait for this target to finish 10 | .EXPORT_ALL_VARIABLES: ; # send all vars to shell 11 | Makefile: ; # skip prerequisite discovery 12 | 13 | # Run make help by default 14 | .DEFAULT_GOAL = help 15 | 16 | .PHONY: env 17 | env: ## Copy .env 18 | cp env.example .env 19 | 20 | .PHONY: up 21 | up: ## Starts and attaches to containers for a service 22 | docker-compose up -d 23 | 24 | .PHONY: stop 25 | stop: check-env ## Stop containers. 26 | docker-compose stop 27 | 28 | .PHONY: bash 29 | bash: ## Exec bash inside app container 30 | docker-compose exec wordpress bash 31 | 32 | %: 33 | @: 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Pure WordPress Docker 2 | 3 | Easy WordPress development with Docker. 4 | 5 | ## Configuration 6 | 7 | Copy the example environment into `.env` 8 | 9 | ``` 10 | make env 11 | ``` 12 | 13 | ## Installation 14 | 15 | ``` 16 | make up 17 | ``` 18 | 19 | ## Usage 20 | 21 | ### Exec bash inside app container 22 | 23 | ``` 24 | make bash 25 | ``` 26 | 27 | ### Stopping containers 28 | 29 | ``` 30 | make stop 31 | ``` 32 | 33 | ### Creating database dumps 34 | 35 | ``` 36 | todo 37 | ``` 38 | 39 | ### phpMyAdmin 40 | 41 | You can also visit `http://127.0.0.1:8080` to access phpMyAdmin after starting the containers. 42 | -------------------------------------------------------------------------------- /config/php.conf.ini: -------------------------------------------------------------------------------- 1 | file_uploads = On 2 | memory_limit = 1024M 3 | upload_max_filesize = 100M 4 | post_max_size = 100M 5 | max_execution_time = 500 6 | 7 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | wordpress: 5 | image: wordpress:latest 6 | ports: 7 | - ${HOST}:${PORT}:80 8 | volumes: 9 | - ./config/php.conf.ini:/usr/local/etc/php/conf.d/conf.ini 10 | - ./wp-app:/var/www/html 11 | environment: 12 | WORDPRESS_DB_HOST: db 13 | WORDPRESS_DB_NAME: "${DB_NAME}" 14 | WORDPRESS_DB_USER: root 15 | WORDPRESS_DB_PASSWORD: "${DB_ROOT_PASSWORD}" 16 | depends_on: 17 | - db 18 | links: 19 | - db 20 | 21 | phpmyadmin: 22 | image: phpmyadmin/phpmyadmin 23 | environment: 24 | PMA_HOST: db 25 | PMA_PORT: 3306 26 | MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}" 27 | UPLOAD_LIMIT: 50M 28 | ports: 29 | - "${HOST}:8080:80" 30 | links: 31 | - db:db 32 | 33 | db: 34 | image: mysql:latest 35 | ports: 36 | - "${HOST}:3306:3306" 37 | command: [ 38 | '--default_authentication_plugin=mysql_native_password', 39 | '--character-set-server=utf8mb4', 40 | '--collation-server=utf8mb4_unicode_ci' 41 | ] 42 | volumes: 43 | - ./wp-data:/docker-entrypoint-initdb.d 44 | - db_data:/var/lib/mysql 45 | environment: 46 | MYSQL_DATABASE: "${DB_NAME}" 47 | MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}" 48 | 49 | volumes: 50 | db_data: 51 | -------------------------------------------------------------------------------- /env.example: -------------------------------------------------------------------------------- 1 | HOST=127.0.0.1 2 | PORT=80 3 | DB_ROOT_PASSWORD=password 4 | DB_NAME=wordpress 5 | --------------------------------------------------------------------------------