Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
tasks:
- init: |
docker-compose pull
docker compose pull
- command: |
docker-compose up
docker compose up

vscode:
extensions:
Expand Down
29 changes: 20 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
version: '3'

services:
db:
image: mariadb:latest
image: mariadb:lts
volumes:
- db_data:/var/lib/mysql
restart: always
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions docker-instructions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.

2 changes: 1 addition & 1 deletion docker-instructions/apache2-wp-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion docker-instructions/settings-sample.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion docker-instructions/settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion docker-instructions/wp-cli-multidomain.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down