Skip to content

Commit c19301b

Browse files
committed
Switch from MariaDB to MySQL. Closes #74
1 parent fe6221b commit c19301b

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

boilerplate-tooling/docker-compose.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
services:
22
# Primary database for the local WordPress development environment.
3-
# Image from: https://hub.docker.com/_/mariadb
3+
# Image from: https://hub.docker.com/_/mysql
44
db:
5-
image: &db_img mariadb:11.5
5+
image: &db_img mysql:8.4
66
restart: always
77
volumes:
88
- db_data:/var/lib/mysql
@@ -69,7 +69,7 @@ services:
6969
# Image from: https://hub.docker.com/r/ideasonpurpose/docker-build
7070
tools:
7171
# image: ideasonpurpose/docker-build:dev
72-
image: ideasonpurpose/docker-build:0.17.1
72+
image: ideasonpurpose/docker-build:0.17.2
7373
user: "${UID:-1000}:${GID:-1000}"
7474
depends_on:
7575
- wordpress
@@ -85,7 +85,7 @@ services:
8585
# Utility service for running composer commands
8686
# Image from: https://hub.docker.com/_/composer
8787
composer:
88-
image: composer:2.7
88+
image: composer:2.8
8989
profiles: ["utility"]
9090
user: "${UID:-1000}:${GID:-1000}"
9191
environment:
@@ -118,7 +118,7 @@ services:
118118
# Runs phpMyAdmin on port 8002
119119
# Image from: https://hub.docker.com/_/phpmyadmin
120120
phpmyadmin:
121-
image: phpmyadmin:5.2.1-apache
121+
image: phpmyadmin:5.2-apache
122122
profiles: ["utility"]
123123
ports:
124124
- "${npm_config_port:-8002}:80"
@@ -172,17 +172,17 @@ services:
172172
# NOTE: The datbase dumpfile will include these CREATE/USE commands:
173173
# CREATE DATABASE `wordpress`;
174174
# USE `wordpress`;
175-
# to drop those lines, remove "--databases" from the mariadb-dump command
175+
# to drop those lines, remove "--databases" from the mysqldump command
176176
command: |
177177
bash -c 'for i in {1..10}
178-
do echo -e "⏳ \033[33mWaiting for MariaDB server...\033[0m" &&
179-
mariadb --skip-ssl -s -h db -e "exit" && break || sleep 3
178+
do echo -e "⏳ \033[33mWaiting for DB server...\033[0m" &&
179+
mysql --ssl-mode=DISABLED -s -h db -e "exit" && break || sleep 3
180180
done &&
181181
sleep 2 &&
182-
echo -e "✔️ \033[32mConnected to MariaDB\033[0m" &&
182+
echo -e "✔️ \033[32mConnected to DB\033[0m" &&
183183
export DUMPFILE="/usr/src/'${npm_package_name:-dumpfile}'-$$(date +%FT%H%M%S).sql" &&
184184
echo $${DUMPFILE} &&
185-
mariadb-dump --skip-ssl -hdb --databases $${MYSQL_DATABASE} > "$${DUMPFILE}" &&
185+
mysqldump --ssl-mode=DISABLED -hdb --databases $${MYSQL_DATABASE} > "$${DUMPFILE}" &&
186186
gzip "$${DUMPFILE}" &&
187187
chown -R $${OWNER_GROUP} /usr/src &&
188188
echo "Successfully dumped database to \"$${DUMPFILE}.gz\""'
@@ -199,16 +199,16 @@ services:
199199
MYSQL_DATABASE: wordpress
200200
command: |
201201
bash -c 'for i in {1..10}
202-
do echo -e "⏳ \033[33mWaiting for MariaDB server...\033[0m" &&
203-
mariadb --skip-ssl -s -h db -e "exit" && break || sleep 3
202+
do echo -e "⏳ \033[33mWaiting for DB server...\033[0m" &&
203+
mysql --ssl-mode=DISABLED -s -h db -e "exit" && break || sleep 3
204204
done &&
205205
sleep 2 &&
206-
echo -e "✔️ \033[32mConnected to MariaDB\033[0m" &&
207-
mariadb-admin --skip-ssl -hdb -v -f drop $${MYSQL_DATABASE} &&
208-
mariadb-admin --skip-ssl -hdb -v -f create $${MYSQL_DATABASE} &&
206+
echo -e "✔️ \033[32mConnected to DB\033[0m" &&
207+
mysqladmin --ssl-mode=DISABLED -hdb -v -f drop $${MYSQL_DATABASE} &&
208+
mysqladmin --ssl-mode=DISABLED -hdb -v -f create $${MYSQL_DATABASE} &&
209209
echo Database \"$${MYSQL_DATABASE}\" created &&
210210
echo Reloading database from dumpfile &&
211-
mariadb --skip-ssl -hdb $${MYSQL_DATABASE} < $$(ls /usr/src/dumpfiles/*.sql | tail -n1)'
211+
mysql --ssl-mode=DISABLED -hdb $${MYSQL_DATABASE} < $$(ls /usr/src/dumpfiles/*.sql | tail -n1)'
212212
213213
# Activates the theme directly in the database
214214
theme-activate:
@@ -223,20 +223,20 @@ services:
223223
command: |
224224
bash -c 'for i in {1..10}
225225
do echo -e "⏳ \033[33mWaiting for DB server...\033[0m" &&
226-
mariadb --skip-ssl -s -h db -e "exit" && break || sleep 3
226+
mysql --ssl-mode=DISABLED -s -h db -e "exit" && break || sleep 3
227227
done &&
228228
sleep 2 &&
229-
echo -e "✔️ \033[32mConnected to MariaDB\033[0m" &&
230-
if [[ $$(mariadb --skip-ssl -s -h db $${MYSQL_DATABASE} -e "SHOW TABLES LIKE \"wp_options\"") ]]
229+
echo -e "✔️ \033[32mConnected to DB\033[0m" &&
230+
if [[ $$(mysql --ssl-mode=DISABLED -s -h db $${MYSQL_DATABASE} -e "SHOW TABLES LIKE \"wp_options\"") ]]
231231
then
232232
echo -e "🎨 \033[36mActivating theme \033[0m\033[1m${npm_package_name:-ioptheme}\033[0m"
233-
mariadb --skip-ssl -h db $${MYSQL_DATABASE} \
233+
mysql --ssl-mode=DISABLED -h db $${MYSQL_DATABASE} \
234234
-e "UPDATE wp_options \
235235
SET option_value = \"'${npm_package_name:-ioptheme}'\" \
236236
WHERE option_name in (\"template\",\"stylesheet\")"
237237
else
238238
echo -e "Unable to activate theme: \033[31m'\'wp_options\'' table does not exist.\033[0m"
239-
echo "To recreate an existing site, copy the site'\''s MariaDB dumpfile into _db"
239+
echo "To recreate an existing site, copy the site'\''s DB dumpfile into _db"
240240
echo If this project is starting from an empty database, you can ignore this message.
241241
fi'
242242

0 commit comments

Comments
 (0)