digitaldemocratic/dd-apps/docker/wordpress/wordpress.yml

83 lines
2.7 KiB
YAML
Raw Normal View History

#
# Copyright © 2021,2022 IsardVDI S.L.
#
# This file is part of DD
#
# DD is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# DD is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License
# along with DD. If not, see <https://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
version: '3.7'
x-volumes:
&wordpress-volumes
- /etc/localtime:/etc/localtime:ro
- ${BUILD_APPS_ROOT_PATH}/docker/wordpress/src/config/php.conf.ini:/usr/local/etc/php/conf.d/conf.ini
- ${SRC_FOLDER}/wordpress:/var/www/html
- ${BUILD_APPS_ROOT_PATH}/docker/wordpress/plugins:/plugins
- ${BUILD_APPS_ROOT_PATH}/docker/wordpress/.htaccess:/var/www/html/.htaccess:ro
- ${BUILD_APPS_ROOT_PATH}/docker/wordpress/multisite.sh:/multisite.sh:ro
- ${DATA_FOLDER}/wordpress:/var/www/html/wp-content/uploads
services:
dd-apps-wordpress:
image: ${WORDPRESS_IMG}
container_name: dd-apps-wordpress
volumes:
*wordpress-volumes
environment:
WORDPRESS_DB_HOST: dd-apps-mariadb
WORDPRESS_DB_NAME: "wordpress"
WORDPRESS_DB_USER: ${WORDPRESS_MARIADB_USER}
WORDPRESS_DB_PASSWORD: ${WORDPRESS_MARIADB_PASSWORD}
WORDPRESS_DOMAIN_CURRENT_SITE: wp.${DOMAIN}
depends_on:
- dd-apps-mariadb
links:
- dd-apps-mariadb
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80"]
interval: 30s
timeout: 10s
retries: 5
networks:
- dd_net
dd-apps-wordpress-cli:
image: ${WORDPRESS_CLI_IMG}
container_name: dd-apps-wordpress-cli
volumes:
*wordpress-volumes
command: >
bash -c 'wp core install --path="/var/www/html" --url=wp.${DOMAIN} --title="${TITLE}" --admin_user=${WORDPRESS_ADMIN_USER} --admin_password=${WORDPRESS_ADMIN_PASSWORD} --admin_email=${SMTP_USER};
wp core multisite-convert;'
depends_on:
dd-apps-mariadb:
condition: service_healthy
dd-apps-wordpress:
condition: service_healthy
networks:
- dd_net
restart: "no"
environment:
WORDPRESS_DB_HOST: dd-apps-mariadb
WORDPRESS_DB_NAME: "wordpress"
WORDPRESS_DB_USER: ${WORDPRESS_MARIADB_USER}
WORDPRESS_DB_PASSWORD: ${WORDPRESS_MARIADB_PASSWORD}
DOMAIN: ${DOMAIN}
TITLE: ${TITLE}
SMTP_USER: ${SMTP_USER}