From 56abc5ccd1397868ca743eb28a2c3c2d6c42639b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Mar 2026 09:21:23 +0000 Subject: [PATCH 1/3] Initial plan From 614b9703afef2ddf7d897ffe1ca1e493fcb92b12 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Mar 2026 09:24:31 +0000 Subject: [PATCH 2/3] Update Docker and WordPress environment to latest specs Co-authored-by: zoukkinen <13482755+zoukkinen@users.noreply.github.com> Agent-Logs-Url: https://github.com/zoukkinen/docker-compose-wordpress-development/sessions/4a4b4d52-6079-4041-9a08-bc124a53149c --- .gitpod.yml | 4 ++-- docker-compose.yml | 29 ++++++++++++++++++-------- docker-instructions/README.md | 10 ++++----- docker-instructions/settings-sample.sh | 2 +- docker-instructions/settings.sh | 2 +- 5 files changed, 29 insertions(+), 18 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 90ef31f..ea6f1e7 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,8 +1,8 @@ tasks: - init: | - docker-compose pull + docker compose pull - command: | - docker-compose up + docker compose up vscode: extensions: diff --git a/docker-compose.yml b/docker-compose.yml index ccba1d5..cd79eee 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,6 @@ -version: '3' - services: db: - image: mariadb:latest + image: mariadb:lts volumes: - db_data:/var/lib/mysql restart: always @@ -13,10 +11,17 @@ services: MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress + healthcheck: + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] + start_period: 10s + interval: 10s + timeout: 5s + retries: 5 wordpress: depends_on: - - db + db: + condition: service_healthy image: wordpress:latest ports: - "8080:80" @@ -25,6 +30,7 @@ services: WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_USER: wordpress WORDPRESS_DB_PASSWORD: wordpress + WORDPRESS_DB_NAME: wordpress working_dir: /var/www/html volumes: - ./wp-content:/var/www/html/wp-content:rw @@ -35,21 +41,25 @@ services: phpmyadmin: - image: phpmyadmin/phpmyadmin - links: - - db:mysql + image: phpmyadmin + depends_on: + db: + condition: service_healthy ports: - "8181:80" restart: always environment: MYSQL_USERNAME: root MYSQL_ROOT_PASSWORD: somewordpress + PMA_HOST: db PMA_PORT: "3306" wordpress-cli: depends_on: - - db - - wordpress + db: + condition: service_healthy + wordpress: + condition: service_started image: wordpress:cli restart: always # This is required to run wordpress-cli with the same @@ -62,6 +72,7 @@ services: WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_USER: wordpress WORDPRESS_DB_PASSWORD: wordpress + WORDPRESS_DB_NAME: wordpress volumes: # add shared volume - wp_data:/var/www/html:rw diff --git a/docker-instructions/README.md b/docker-instructions/README.md index a0c7cdc..66841d2 100644 --- a/docker-instructions/README.md +++ b/docker-instructions/README.md @@ -16,21 +16,21 @@ If you are using Gitpod, you don't need to anything. It is adviced to change you After you have legit export file set `settings.sh`varable `IMPORT` to `true` 5. Open repository in commandline -6. Run ```docker-compose up``` +6. Run ```docker compose up``` 7. After everything You get the login info and commet: **SH-comment: Complete**, you can Control+C the terminal 8. To start the terminal on the background use command: - ```docker-compose up -d``` + ```docker compose up -d``` And to shutdown the containers use command: - ```docker-compose down``` + ```docker compose down``` To remove the containers for good (you need to start over) use command: - ```docker-compose down --volumes``` + ```docker compose down --volumes``` ## Here are the settings and credentials when the containers are running: @@ -73,7 +73,7 @@ To use the settings, just uncomment the line in `docker-compose.yml` file that i 1. Go to your production or staging site and under tools you can export a file. Check first that you have `wp-export-menus`-plugin installed to also get the menus Put this file in the [docker-insructions/](./) (this) folder and save it on it's own name and dublicate as `yoursite.wordpress.latest.xml` You can change the name in `settings.sh` file and set the importer value `IMPORT` to `true` to use the import-file during initial setup. -2. Delete yor local environment with command: `docker-compose down --volumes` +2. Delete yor local environment with command: `docker compose down --volumes` 3. Run the `docker compose up` again to install fresh version with new data. diff --git a/docker-instructions/settings-sample.sh b/docker-instructions/settings-sample.sh index 512c7cc..4d4dc56 100644 --- a/docker-instructions/settings-sample.sh +++ b/docker-instructions/settings-sample.sh @@ -5,7 +5,7 @@ SITEURL="http://localhost:8080" ADMIN_USER="admin" ADMIN_PASSWORD="password" ADMIN_EMAIL="example@example.com" -ACTIVE_THEME_NAME="twentynineteen" +ACTIVE_THEME_NAME="twentytwentyfive" # List the wordpress.org hosted plugins you want to install to the site. (slug1 slug2) PLUGINS="better-search-replace classic-editor wordpress-importer wp-export-menus" diff --git a/docker-instructions/settings.sh b/docker-instructions/settings.sh index 3f341b4..39b1f3c 100644 --- a/docker-instructions/settings.sh +++ b/docker-instructions/settings.sh @@ -5,7 +5,7 @@ SITEURL="http://localhost:8080" ADMIN_USER="admin" ADMIN_PASSWORD="password" ADMIN_EMAIL="example@example.com" -ACTIVE_THEME_NAME="twentynineteen" +ACTIVE_THEME_NAME="twentytwentyfive" # List the wordpress.org hosted plugins you want to install to the site. (slug1 slug2) PLUGINS="better-search-replace classic-editor wordpress-importer wp-export-menus" From 0759689af834bf20c7e9c7aa2f93e47f2f19a6d2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Mar 2026 09:32:14 +0000 Subject: [PATCH 3/3] Fix shell script bugs in docker-instructions Co-authored-by: zoukkinen <13482755+zoukkinen@users.noreply.github.com> Agent-Logs-Url: https://github.com/zoukkinen/docker-compose-wordpress-development/sessions/eeaca37b-aab2-44c7-8653-a181df8083cf --- docker-instructions/apache2-wp-cli.sh | 2 +- docker-instructions/wp-cli-multidomain.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-instructions/apache2-wp-cli.sh b/docker-instructions/apache2-wp-cli.sh index 4324921..03c2f49 100644 --- a/docker-instructions/apache2-wp-cli.sh +++ b/docker-instructions/apache2-wp-cli.sh @@ -139,7 +139,7 @@ else sleep 2s /usr/local/bin/wp search-replace $OLD_SITE_NAME $SITEURL /usr/local/bin/wp search-replace $OLD_SITE_NAME2 $SITEURL - §echo "" + echo "" fi echo "SH-comment: Setting permalink structure" diff --git a/docker-instructions/wp-cli-multidomain.sh b/docker-instructions/wp-cli-multidomain.sh index 724933d..25a9f73 100644 --- a/docker-instructions/wp-cli-multidomain.sh +++ b/docker-instructions/wp-cli-multidomain.sh @@ -1,5 +1,5 @@ #!/bin/bash -set x +set -x /usr/local/bin/wp config set WP_HOME "'http://' . "'$'"_SERVER['HTTP_HOST'] . '/'" --raw echo "SH-comment: WP_HOME set" /usr/local/bin/wp config set WP_SITEURL "'http://' . "'$'"_SERVER['HTTP_HOST'] . '/'" --raw