Skip to content

Commit ef845cb

Browse files
committed
Adds scripts to wordpress lab
1 parent 3c5b04c commit ef845cb

File tree

7 files changed

+33
-0
lines changed

7 files changed

+33
-0
lines changed

lab/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*/local/*

lab/wordpress/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ RUN su mysql -s /bin/sh -c 'mysql_install_db --datadir=/var/lib/mysql'
2323
RUN mkdir /app
2424
RUN curl -s https://en-gb.wordpress.org/latest-en_GB.tar.gz -o /app/wordpress.tgz
2525
RUN tar xvzf /app/wordpress.tgz -C /app/
26+
RUN chmod -R 777 /app/wordpress/wp-content
2627

2728
# Wordpress config
2829
ADD wp-config.php /app/wordpress/

lab/wordpress/init-local.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
ROOT_PATH=$(cd $(dirname $0) && pwd)
3+
4+
echo "Installing to $ROOT_PATH/local/"
5+
6+
mkdir -p "$ROOT_PATH/local"
7+
8+
curl -s https://en-gb.wordpress.org/latest-en_GB.tar.gz -o "$ROOT_PATH/local/wordpress.tgz"
9+
tar xvzf "$ROOT_PATH/local/wordpress.tgz" -C "$ROOT_PATH/local/"
10+
11+
cp "$ROOT_PATH/wp-config.php" "$ROOT_PATH/local/wordpress/"

lab/wordpress/notes

+9
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,12 @@ MySQL command:
66

77
Supervisor command:
88
/usr/bin/supervisord -n -c /etc/supervisord.conf
9+
10+
Get container PID:
11+
docker inspect --format {{.State.Pid}}
12+
FS is in /proc/$PID/root
13+
14+
TODO:
15+
Handle change of page URL somehow ¯\_(ツ)_/¯
16+
17+

lab/wordpress/run-local.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
ROOT_PATH=$(cd $(dirname $0) && pwd)
3+
4+
docker run -it -p 5050:8080 -v "$ROOT_PATH/local:/app" $1

lab/wordpress/run.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
ROOT_PATH=$(cd $(dirname $0) && pwd)
3+
4+
docker run -it -p 5050:8080 $1

lab/wordpress/wp-config.php

+3
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@
7979
*/
8080
define( 'WP_DEBUG', false );
8181

82+
// direct plugin installs
83+
define('FS_METHOD', 'direct');
84+
8285
/* That's all, stop editing! Happy publishing. */
8386

8487
/** Absolute path to the WordPress directory. */

0 commit comments

Comments
 (0)