├── .github ├── actions │ ├── action.yml │ └── release.sh └── workflows │ └── workflow.yml ├── .gitignore ├── .php ├── Dockerfile ├── LICENSE.md ├── Makefile ├── README.md ├── bin ├── actions.mk ├── duplicator_import └── init_wordpress ├── init └── 10-wordpress-php.sh ├── templates ├── wodby.wp-config.php.tmpl └── wp-config.php.tmpl └── tests ├── compose.yml ├── run.sh └── tests.sh /.github/actions/action.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | description: Build WordPress PHP image 3 | inputs: 4 | version: 5 | description: php version 6 | required: true 7 | tags: 8 | description: image tags 9 | required: true 10 | dev: 11 | description: dev version of image 12 | required: false 13 | dev_macos: 14 | description: dev macos version of image 15 | required: false 16 | platform: 17 | description: docker platform 18 | required: false 19 | default: linux/amd64 20 | runs: 21 | using: "composite" 22 | steps: 23 | - name: Build and push image to docker hub 24 | env: 25 | PHP_VER: ${{ inputs.version }} 26 | PHP_DEV: ${{ inputs.dev }} 27 | PHP_DEV_MACOS: ${{ inputs.dev_macos }} 28 | TAGS: ${{ inputs.tags }} 29 | PLATFORM: ${{ inputs.platform }} 30 | DOCKER_REGISTRY: docker.io 31 | run: | 32 | set -e 33 | make buildx-build-amd64 34 | make test 35 | make buildx-build 36 | . $GITHUB_ACTION_PATH/release.sh 37 | shell: bash 38 | # - name: Build and push amd64 image to wodby registry 39 | # env: 40 | # PHP_VER: ${{ inputs.version }} 41 | # PHP_DEV: ${{ inputs.dev }} 42 | # PHP_DEV_MACOS: ${{ inputs.dev_macos }} 43 | # DOCKER_REGISTRY: registry.wodby.com 44 | # TAGS: ${{ inputs.tags }} 45 | # PLATFORM: linux/amd64 46 | # run: | 47 | # set -e 48 | # if [[ -z "${PHP_DEV}" && -z "${PHP_DEV_MACOS}" ]]; then 49 | # DOCKER_USERNAME="${WODBY1_REGISTRY_USERNAME}" DOCKER_PASSWORD="${WODBY1_REGISTRY_PASSWORD}" . $GITHUB_ACTION_PATH/release.sh 50 | # else 51 | # echo "" 52 | # echo "Push to registry.wodby.com skipped" 53 | # fi 54 | # shell: bash 55 | -------------------------------------------------------------------------------- /.github/actions/release.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if [[ "${GITHUB_REF}" == refs/heads/master || "${GITHUB_REF}" == refs/tags/* ]]; then 6 | docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" 7 | 8 | if [[ "${GITHUB_REF}" == refs/tags/* ]]; then 9 | export STABILITY_TAG="${GITHUB_REF##*/}" 10 | fi 11 | 12 | IFS=',' read -ra tags <<< "${TAGS}" 13 | 14 | for tag in "${tags[@]}"; do 15 | make buildx-push TAG="${tag}" REGISTRY="${DOCKER_REGISTRY}"; 16 | done 17 | fi 18 | -------------------------------------------------------------------------------- /.github/workflows/workflow.yml: -------------------------------------------------------------------------------- 1 | name: Build docker image 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | - 4.x 8 | 9 | tags: 10 | - '*' 11 | 12 | pull_request: 13 | 14 | env: 15 | DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} 16 | DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} 17 | 18 | jobs: 19 | php84: 20 | runs-on: ubuntu-latest 21 | steps: 22 | - uses: actions/checkout@v4 23 | - uses: docker/setup-qemu-action@v3 24 | with: 25 | platforms: amd64,arm64 26 | - uses: docker/setup-buildx-action@v3 27 | - uses: ./.github/actions 28 | with: 29 | version: '8.4' 30 | tags: 8.4,8,latest 31 | platform: linux/amd64,linux/arm64 32 | php83: 33 | runs-on: ubuntu-latest 34 | steps: 35 | - uses: actions/checkout@v4 36 | - uses: docker/setup-qemu-action@v3 37 | with: 38 | platforms: amd64,arm64 39 | - uses: docker/setup-buildx-action@v3 40 | - uses: ./.github/actions 41 | with: 42 | version: '8.3' 43 | tags: 8.3 44 | platform: linux/amd64,linux/arm64 45 | php82: 46 | runs-on: ubuntu-latest 47 | steps: 48 | - uses: actions/checkout@v4 49 | - uses: docker/setup-qemu-action@v3 50 | with: 51 | platforms: amd64,arm64 52 | - uses: docker/setup-buildx-action@v3 53 | - uses: ./.github/actions 54 | with: 55 | version: '8.2' 56 | tags: 8.2 57 | platform: linux/amd64,linux/arm64 58 | php81: 59 | runs-on: ubuntu-latest 60 | steps: 61 | - uses: actions/checkout@v4 62 | - uses: docker/setup-qemu-action@v3 63 | with: 64 | platforms: amd64,arm64 65 | - uses: docker/setup-buildx-action@v3 66 | - uses: ./.github/actions 67 | with: 68 | version: '8.1' 69 | tags: 8.1 70 | platform: linux/amd64,linux/arm64 71 | ### dev 72 | php84-dev: 73 | runs-on: ubuntu-latest 74 | steps: 75 | - uses: actions/checkout@v4 76 | - uses: docker/setup-qemu-action@v3 77 | with: 78 | platforms: amd64,arm64 79 | - uses: docker/setup-buildx-action@v3 80 | - uses: ./.github/actions 81 | with: 82 | version: '8.4' 83 | dev: 1 84 | tags: 8.4-dev,8-dev,dev 85 | platform: linux/amd64,linux/arm64 86 | php83-dev: 87 | runs-on: ubuntu-latest 88 | steps: 89 | - uses: actions/checkout@v4 90 | - uses: docker/setup-qemu-action@v3 91 | with: 92 | platforms: amd64,arm64 93 | - uses: docker/setup-buildx-action@v3 94 | - uses: ./.github/actions 95 | with: 96 | version: '8.3' 97 | dev: 1 98 | tags: 8.3-dev 99 | platform: linux/amd64,linux/arm64 100 | php82-dev: 101 | runs-on: ubuntu-latest 102 | steps: 103 | - uses: actions/checkout@v4 104 | - uses: docker/setup-qemu-action@v3 105 | with: 106 | platforms: amd64,arm64 107 | - uses: docker/setup-buildx-action@v3 108 | - uses: ./.github/actions 109 | with: 110 | version: '8.2' 111 | dev: 1 112 | tags: 8.2-dev 113 | platform: linux/amd64,linux/arm64 114 | php81-dev: 115 | runs-on: ubuntu-latest 116 | steps: 117 | - uses: actions/checkout@v4 118 | - uses: docker/setup-qemu-action@v3 119 | with: 120 | platforms: amd64,arm64 121 | - uses: docker/setup-buildx-action@v3 122 | - uses: ./.github/actions 123 | with: 124 | version: '8.1' 125 | dev: 1 126 | tags: 8.1-dev 127 | platform: linux/amd64,linux/arm64 128 | ### dev-macos 129 | php84-dev-macos: 130 | runs-on: ubuntu-latest 131 | steps: 132 | - uses: actions/checkout@v4 133 | - uses: docker/setup-qemu-action@v3 134 | with: 135 | platforms: amd64,arm64 136 | - uses: docker/setup-buildx-action@v3 137 | - uses: ./.github/actions 138 | with: 139 | version: '8.4' 140 | dev_macos: 1 141 | tags: 8.4-dev-macos,8-dev-macos,dev-macos 142 | platform: linux/amd64,linux/arm64 143 | php83-dev-macos: 144 | runs-on: ubuntu-latest 145 | steps: 146 | - uses: actions/checkout@v4 147 | - uses: docker/setup-qemu-action@v3 148 | with: 149 | platforms: amd64,arm64 150 | - uses: docker/setup-buildx-action@v3 151 | - uses: ./.github/actions 152 | with: 153 | version: '8.3' 154 | dev_macos: 1 155 | tags: 8.3-dev-macos 156 | platform: linux/amd64,linux/arm64 157 | php82-dev-macos: 158 | runs-on: ubuntu-latest 159 | steps: 160 | - uses: actions/checkout@v4 161 | - uses: docker/setup-qemu-action@v3 162 | with: 163 | platforms: amd64,arm64 164 | - uses: docker/setup-buildx-action@v3 165 | - uses: ./.github/actions 166 | with: 167 | version: '8.2' 168 | dev_macos: 1 169 | tags: 8.2-dev-macos 170 | platform: linux/amd64,linux/arm64 171 | php81-dev-macos: 172 | runs-on: ubuntu-latest 173 | steps: 174 | - uses: actions/checkout@v4 175 | - uses: docker/setup-qemu-action@v3 176 | with: 177 | platforms: amd64,arm64 178 | - uses: docker/setup-buildx-action@v3 179 | - uses: ./.github/actions 180 | with: 181 | version: '8.1' 182 | dev_macos: 1 183 | tags: 8.1-dev-macos 184 | platform: linux/amd64,linux/arm64 185 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | -------------------------------------------------------------------------------- /.php: -------------------------------------------------------------------------------- 1 | 8.4#2025-05-23T02:58:38.392214Z 2 | 8.3#2025-05-23T02:58:38.392214Z 3 | 8.2#2025-05-23T02:58:38.392214Z 4 | 8.1#2025-05-23T02:58:38.392214Z -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE_TAG 2 | 3 | FROM wodby/php:${BASE_IMAGE_TAG} 4 | 5 | USER root 6 | 7 | RUN set -ex; \ 8 | \ 9 | apk add --no-cache -t .wordperss-php-run-deps p7zip; \ 10 | apk add --no-cache -t .fetch-deps gnupg; \ 11 | \ 12 | cd /tmp; \ 13 | wp_cli_version="2.12.0"; \ 14 | url="https://github.com/wp-cli/wp-cli/releases/download/v${wp_cli_version}/wp-cli-${wp_cli_version}.phar"; \ 15 | curl -o wp.phar -fSL "${url}"; \ 16 | chmod +x wp.phar; \ 17 | mv wp.phar /usr/local/bin/wp; \ 18 | \ 19 | url="https://raw.githubusercontent.com/wp-cli/wp-cli/v${wp_cli_version}/utils/wp-completion.bash"; \ 20 | curl -o /usr/local/include/wp-completion.bash -fSL "${url}"; \ 21 | chmod +x /usr/local/include/wp-completion.bash; \ 22 | cd /home/wodby; \ 23 | echo "source /usr/local/include/wp-completion.bash" | tee -a .bash_profile .bashrc; \ 24 | \ 25 | if [[ -z "${PHP_DEV}" ]]; then \ 26 | echo "$(cat /etc/sudoers.d/wodby), /usr/local/bin/init_wordpress" > /etc/sudoers.d/wodby; \ 27 | fi; \ 28 | \ 29 | mv /usr/local/bin/actions.mk /usr/local/bin/php.mk; \ 30 | \ 31 | apk del --purge .fetch-deps; \ 32 | rm -rf /var/cache/apk/* /tmp/* 33 | 34 | USER wodby 35 | 36 | COPY templates /etc/gotpl/ 37 | COPY bin /usr/local/bin 38 | COPY init /docker-entrypoint-init.d/ -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2016 Wodby, Inc. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | -include env_make 2 | 3 | PHP_VER ?= 8.4 4 | 5 | BASE_IMAGE_TAG = $(PHP_VER) 6 | REGISTRY ?= docker.io 7 | REPO = $(REGISTRY)/wodby/wordpress-php 8 | NAME = wordpress-php-$(PHP_VER) 9 | 10 | PLATFORM ?= linux/arm64 11 | 12 | ifeq ($(TAG),) 13 | ifneq ($(PHP_DEBUG),) 14 | TAG = $(PHP_VER)-debug 15 | else ifneq ($(PHP_DEV_MACOS),) 16 | TAG = $(PHP_VER)-dev-macos 17 | else ifneq ($(PHP_DEV),) 18 | TAG = $(PHP_VER)-dev 19 | else 20 | TAG = $(PHP_VER) 21 | endif 22 | endif 23 | 24 | ifneq ($(PHP_DEV_MACOS),) 25 | NAME := $(NAME)-dev-macos 26 | BASE_IMAGE_TAG := $(BASE_IMAGE_TAG)-dev-macos 27 | else ifneq ($(PHP_DEV),) 28 | NAME := $(NAME)-dev 29 | BASE_IMAGE_TAG := $(BASE_IMAGE_TAG)-dev 30 | else ifneq ($(PHP_DEBUG),) 31 | NAME := $(NAME)-debug 32 | BASE_IMAGE_TAG := $(BASE_IMAGE_TAG)-debug 33 | endif 34 | 35 | ifneq ($(BASE_IMAGE_STABILITY_TAG),) 36 | BASE_IMAGE_TAG := $(BASE_IMAGE_TAG)-$(BASE_IMAGE_STABILITY_TAG) 37 | endif 38 | 39 | ifneq ($(STABILITY_TAG),) 40 | ifneq ($(TAG),latest) 41 | override TAG := $(TAG)-$(STABILITY_TAG) 42 | endif 43 | endif 44 | 45 | .PHONY: build buildx-build buildx-push test push shell run start stop logs clean release 46 | 47 | default: build 48 | 49 | build: 50 | docker build -t $(REPO):$(TAG) --build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG) ./ 51 | 52 | # --load doesn't work with multiple platforms https://github.com/docker/buildx/issues/59 53 | # we need to save cache to run tests first. 54 | buildx-build-amd64: 55 | docker buildx build \ 56 | --platform linux/amd64 \ 57 | --build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG) \ 58 | --load \ 59 | -t $(REPO):$(TAG) \ 60 | ./ 61 | 62 | buildx-build: 63 | docker buildx build \ 64 | --platform $(PLATFORM) \ 65 | --build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG) \ 66 | -t $(REPO):$(TAG) ./ 67 | 68 | buildx-push: 69 | docker buildx build --push \ 70 | --platform $(PLATFORM) \ 71 | --build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG) \ 72 | -t $(REPO):$(TAG) ./ 73 | 74 | test: 75 | cd ./tests && IMAGE=$(REPO):$(TAG) ./run.sh 76 | 77 | push: 78 | docker push $(REPO):$(TAG) 79 | 80 | shell: 81 | docker run --rm --name $(NAME) -i -t $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG) /bin/bash 82 | 83 | run: 84 | docker run --rm --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG) $(CMD) 85 | 86 | start: 87 | docker run -d --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG) 88 | 89 | stop: 90 | docker stop $(NAME) 91 | 92 | logs: 93 | docker logs $(NAME) 94 | 95 | clean: 96 | -docker rm -f $(NAME) 97 | 98 | release: build push 99 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PHP for WordPress Docker Container Image 2 | 3 | [![Build Status](https://github.com/wodby/wordpress-php/workflows/Build%20docker%20image/badge.svg)](https://github.com/wodby/wordpress-php/actions) 4 | [![Docker Pulls](https://img.shields.io/docker/pulls/wodby/wordpress-php.svg)](https://hub.docker.com/r/wodby/wordpress-php) 5 | [![Docker Stars](https://img.shields.io/docker/stars/wodby/wordpress-php.svg)](https://hub.docker.com/r/wodby/wordpress-php) 6 | 7 | ## Docker Images 8 | 9 | ❗For better reliability we release images with stability tags (`wodby/wordpress-php:8-X.X.X`) which correspond 10 | to [git tags](https://github.com/wodby/wordpress-php/releases). We strongly recommend using images only with stability 11 | tags. 12 | 13 | Overview: 14 | 15 | - All images based on Alpine Linux 16 | - Base image: [wodby/php](https://github.com/wodby/php) 17 | - [GitHub actions builds](https://github.com/wodby/wordpress-php/actions) 18 | - [Docker Hub](https://hub.docker.com/r/wodby/wordpress-php) 19 | 20 | [_(Dockerfile)_]: https://github.com/wodby/wordpress-php/tree/master/Dockerfile 21 | 22 | Supported tags and respective `Dockerfile` links: 23 | 24 | - `8.4`, `8`, `latest` [_(Dockerfile)_] 25 | - `8.3` [_(Dockerfile)_] 26 | - `8.2` [_(Dockerfile)_] 27 | - `8.1` [_(Dockerfile)_] 28 | - `8.4-dev`, `8-dev`, `dev` [_(Dockerfile)_] 29 | - `8.3-dev` [_(Dockerfile)_] 30 | - `8.2-dev` [_(Dockerfile)_] 31 | - `8.1-dev` [_(Dockerfile)_] 32 | - `8.4-dev-macos`, `8-dev-macos`, `dev-macos` [_(Dockerfile)_] 33 | - `8.3-dev-macos` [_(Dockerfile)_] 34 | - `8.2-dev-macos` [_(Dockerfile)_] 35 | - `8.1-dev-macos` [_(Dockerfile)_] 36 | 37 | All images built for `linux/amd64` and `linux/arm64` 38 | 39 | ## Tools 40 | 41 | This image comes with [WP CLI](https://github.com/wp-cli/wp-cli) version 2.12.0 42 | 43 | ## Environment Variables 44 | 45 | See at [wodby/php](https://github.com/wodby/php) 46 | 47 | ## Orchestration Actions 48 | 49 | Usage: 50 | 51 | ``` 52 | make COMMAND [params ...] 53 | 54 | commands: 55 | duplicator-import source 56 | init-wordpress 57 | cache-clear 58 | 59 | default params values: 60 | target all 61 | is_hash 0 62 | ``` 63 | 64 | See [wodby/php](https://github.com/wodby/php) for all actions 65 | 66 | ## Complete WordPress Stack 67 | 68 | See [Docker4WordPress](https://github.com/wodby/docker4wordpress). 69 | -------------------------------------------------------------------------------- /bin/actions.mk: -------------------------------------------------------------------------------- 1 | -include /usr/local/bin/php.mk 2 | 3 | .PHONY: duplicator-import init-wordpress cache-clear 4 | 5 | check_defined = \ 6 | $(strip $(foreach 1,$1, \ 7 | $(call __check_defined,$1,$(strip $(value 2))))) 8 | __check_defined = \ 9 | $(if $(value $1),, \ 10 | $(error Required parameter is missing: $1$(if $2, ($2)))) 11 | 12 | ifeq ("$(DOCROOT_SUBDIR)", "") 13 | WP_ROOT=$(APP_ROOT) 14 | else 15 | WP_ROOT="$(APP_ROOT)/$(DOCROOT_SUBDIR)" 16 | endif 17 | 18 | default: cache-clear 19 | 20 | duplicator-import: 21 | $(call check_defined, source) 22 | duplicator_import $(source) 23 | 24 | init-wordpress: 25 | WP_ROOT=$(WP_ROOT) sudo -E init_wordpress 26 | 27 | cache-clear: 28 | wp cache flush --path=$(WP_ROOT) 29 | -------------------------------------------------------------------------------- /bin/duplicator_import: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if [[ -n "${DEBUG}" ]]; then 6 | set -x 7 | fi 8 | 9 | source=$1 10 | tmp_dir="/tmp/source" 11 | 12 | get_archive "${source}" "${tmp_dir}" "zip" 13 | 14 | # Import db. 15 | if [[ -f "${tmp_dir}/database.sql" ]]; then 16 | echo "DB dump found. Importing..." 17 | 18 | mysql -h"${DB_HOST}" -u"${DB_USER}" -p"${DB_PASSWORD}" -e "DROP DATABASE IF EXISTS ${DB_NAME};" 19 | mysql -h"${DB_HOST}" -u"${DB_USER}" -p"${DB_PASSWORD}" -e "CREATE DATABASE ${DB_NAME};" 20 | mysql -h"${DB_HOST}" -u"${DB_USER}" -p"${DB_PASSWORD}" "${DB_NAME}" < "${tmp_dir}/database.sql" 21 | else 22 | echo "No db dump found for import" 23 | fi 24 | 25 | # Import files. 26 | if [[ -d "${tmp_dir}/wp-content/uploads" ]]; then 27 | echo "Files directory found: wp-content/uploads. Importing..." 28 | sudo files_sync "${tmp_dir}/wp-content/uploads/" "${FILES_DIR}/public/" 29 | rm -rf "${tmp_dir}/wp-content/uploads" 30 | else 31 | echo "No files directory (wp-content/uploads) found for import" 32 | fi 33 | 34 | rm -rf "${tmp_dir}" 35 | -------------------------------------------------------------------------------- /bin/init_wordpress: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if [[ -n "${DEBUG}" ]]; then 6 | set -x 7 | fi 8 | 9 | disclaimer="// Generated by Wodby (add before wp-settings.php include)." 10 | wp_config="${WP_ROOT}/wp-config.php" 11 | 12 | su-exec wodby mkdir -p "${WP_ROOT}" 13 | 14 | if [[ ! -f "${wp_config}" ]]; then 15 | su-exec wodby gotpl "/etc/gotpl/wp-config.php.tmpl" > "${wp_config}" 16 | chown wodby:wodby "${wp_config}" 17 | elif [[ $( grep -ic "wodby.wp-config.php" "${wp_config}" ) -eq 0 ]]; then 18 | chmod 644 "${wp_config}" 19 | su-exec wodby sed -i "/wp-settings.php/i \\ 20 | ${disclaimer} \\ 21 | require_once '${CONF_DIR}/wodby.wp-config.php';" "${wp_config}" 22 | fi 23 | 24 | wp_content="${WP_ROOT}/wp-content" 25 | su-exec wodby mkdir -p "${wp_content}" 26 | 27 | # Update permissions to allow installing/updating themes and plugins from WP admin dashboard. 28 | chown :www-data "${wp_content}" 29 | chmod 775 "${wp_content}" 30 | 31 | declare -a writable_wp_content_dirs=( 32 | "plugins" 33 | "themes" 34 | "upgrade" 35 | "languages" 36 | "cache" 37 | "wp-rocket-config" 38 | "wflogs" 39 | ) 40 | 41 | for dir in "${writable_wp_content_dirs[@]}"; do 42 | if [[ -d "${wp_content}/${dir}" ]]; then 43 | chown -R :www-data "${wp_content}/${dir}" 44 | chmod -R 775 "${wp_content}/${dir}" 45 | fi 46 | done 47 | 48 | # Symlink public files to files volume 49 | files_link "${wp_content}/uploads" 50 | -------------------------------------------------------------------------------- /init/10-wordpress-php.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if [[ -n "${DEBUG}" ]]; then 6 | set -x 7 | fi 8 | 9 | _gotpl() { 10 | if [[ -f "/etc/gotpl/$1" ]]; then 11 | gotpl "/etc/gotpl/$1" > "$2" 12 | fi 13 | } 14 | 15 | # Remove generic environment config from wodby/php 16 | rm -f "${CONF_DIR}/wodby.settings.php" 17 | 18 | if [[ -n "${WODBY_APP_NAME}" ]]; then 19 | _gotpl "wodby.wp-config.php.tmpl" "${CONF_DIR}/wodby.wp-config.php" 20 | _gotpl "wp-config.php.tmpl" "${CONF_DIR}/wp-config.php" 21 | fi 22 | -------------------------------------------------------------------------------- /templates/wodby.wp-config.php.tmpl: -------------------------------------------------------------------------------- 1 |