This commit is contained in:
leo 2024-08-12 15:27:01 +05:00
commit b9e3ee8e52
3 changed files with 55 additions and 0 deletions

5
README.md Normal file
View File

@ -0,0 +1,5 @@
### blog-wp-install
*docker configuration*
Start: `sudo bash install.sh`

30
docker-compose.yml Normal file
View File

@ -0,0 +1,30 @@
services:
wp-cli:
container_name: wp-cli
image: wordpress:cli-2.11.0-php8.1
networks:
- proxynet
env_file:
- /data/secrets/${SERVER_DOMAIN}/${SERVER_DOMAIN}.env
environment:
WORDPRESS_DB_HOST: mariadb
WORDPRESS_DB_USER: ${MARIADB_USER}
WORDPRESS_DB_NAME: ${MARIADB_DB}
WP_CLI_CACHE_DIR: /tmp/.wp-cli/cache
user: '33'
command: >
sh -c 'wp core install \
--path="/var/www/html" \
--url="https://${SERVER_DOMAIN}" \
--title="Rozen Project" \
--admin_user=Leo \
--admin_password=${WP_ADMIN_PASSWORD} \
--admin_email=${ADMIN_EMAIL} &&
wp language core install ru_RU &&
wp site switch-language ru_RU &&
wp theme install sparkling --activate'
volumes:
- /data/appdata/wordpress:/var/www/html
networks:
proxynet:
external: true

20
install.sh Normal file
View File

@ -0,0 +1,20 @@
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo -e "\033[31mThis script requires superuser rights.\033[0m"
exit 0
fi
SECRETS_PATH=/data/secrets/$SERVER_DOMAIN/$SERVER_DOMAIN.env
trap 'echo -e "\033[31minstall.sh: Something went wrong\033[0m"; exit 1' ERR
set -e
export DEBIAN_FRONTEND=noninteractive
source $SECRETS_PATH
sudo docker compose --env-file $SECRETS_PATH up
trap - ERR
echo "Install wp complete"