diff --git a/README.md b/README.md index ad2f4f2..45e4faf 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,8 @@ Ensure you have the following installed: 1. **Clone the repository**: ```bash - git clone https://github.com/your-username/CaddyWP.git - cd CaddyWP + git clone https://github.com/your-username/caddywp.git + cd caddywp ``` 2. **Run the install script**: @@ -39,9 +39,11 @@ Ensure you have the following installed: ## How It Works - Caddy: Serves as a reverse proxy, automatically obtaining SSL certificates and routing traffic to the correct WordPress container. - WordPress: Each WordPress site is hosted in its own Docker container, ensuring that each site runs in isolation with its own environment and database. - MariaDB: A single MariaDB container serves as the database for all WordPress sites. Each site uses a unique database user and password. +Caddy: Serves as a reverse proxy, automatically obtaining SSL certificates and routing traffic to the correct WordPress container. + +WordPress: Each WordPress site is hosted in its own Docker container, ensuring that each site runs in isolation with its own environment and database. + +MariaDB: A single MariaDB container serves as the database for all WordPress sites. Each site uses a unique database user and password. ## License diff --git a/install.sh b/install.sh index 7505f11..9a0c3cc 100755 --- a/install.sh +++ b/install.sh @@ -87,6 +87,7 @@ while true; do echo "1. Start Caddy:" echo " cd ${CADDY_DIR} && docker compose up -d" fi + reload_caddy echo "2. Start WordPress:" echo " cd ${WP_PROJECT_DIR} && docker compose up -d" echo "3. Run the WordPress setup script:" diff --git a/lib/caddy.sh b/lib/caddy.sh index 2a4d58e..f9a967d 100644 --- a/lib/caddy.sh +++ b/lib/caddy.sh @@ -2,7 +2,7 @@ reload_caddy() { echo "Reloading Caddy configuration..." - docker exec caddy caddy reload --config /etc/caddy/Caddyfile + cd "$CADDY_DIR" && docker compose restart } create_caddy_config() { diff --git a/templates/wp-setup.sh.template b/templates/wp-setup.sh.template index 6a17e89..84b0665 100644 --- a/templates/wp-setup.sh.template +++ b/templates/wp-setup.sh.template @@ -1,13 +1,5 @@ #!/bin/bash -wp_cli() { - docker run --rm \ - --network container:wordpress_${DOMAIN} \ - -v "$(pwd):/var/www/html" \ - wordpress:cli-php8.1 \ - wp "$@" -} - wpcli() { docker compose run --rm wpcli "$@" }