From 28ec39ed9e598e74b5dee52cad41e9b69b5ea10b Mon Sep 17 00:00:00 2001 From: Stephen Miracle Date: Tue, 28 May 2024 14:50:17 -0400 Subject: [PATCH 1/2] adding initial example content. --- examples/sqlite/.env.sample | 7 ++++++ examples/sqlite/compose.yaml | 48 ++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 examples/sqlite/.env.sample create mode 100644 examples/sqlite/compose.yaml diff --git a/examples/sqlite/.env.sample b/examples/sqlite/.env.sample new file mode 100644 index 00000000..2b41e8b9 --- /dev/null +++ b/examples/sqlite/.env.sample @@ -0,0 +1,7 @@ +BYPASS_PATH_PREFIX=/wp-admin,/wp-includes,/wp-content +DB_NAME=wordpress +DB_USER=wordpress +DB_PASSWORD=wordpress +DB_HOST=localhost +DB_PORT=3306 +DB_PREFIX=wp_ diff --git a/examples/sqlite/compose.yaml b/examples/sqlite/compose.yaml new file mode 100644 index 00000000..5b834922 --- /dev/null +++ b/examples/sqlite/compose.yaml @@ -0,0 +1,48 @@ +services: + wordpress: + build: . + restart: always + ports: + - "8099:80" # HTTP + environment: + SERVER_NAME: ${SERVER_NAME:-:80} + WORDPRESS_DB_HOST: ${DB_HOST:-db} + WORDPRESS_DB_USER: ${DB_USER:-exampleuser} + WORDPRESS_DB_PASSWORD: ${DB_PASSWORD:-examplepass} + WORDPRESS_DB_NAME: ${DB_NAME:-exampledb} + WORDPRESS_DEBUG: ${WP_DEBUG:-true} + WORDPRESS_TABLE_PREFIX: ${DB_TABLE_PREFIX:-wp_} + CACHE_LOC: ${CACHE_LOC:-/var/www/html/wp-content/cache} + TTL: ${TTL:-80000} + PURGE_PATH: ${PURGE_PATH:-/__cache/purge} + PURGE_KEY: ${PURGE_KEY:-} + BYPASS_HOME: ${BYPASS_HOME:-false} + BYPASS_PATH_PREFIXES: ${BYPASS_PATH_PREFIXES:-/wp-admin,wp-includes} + CACHE_RESPONSE_CODES: ${CACHE_RESPONSE_CODES:-2XX,404,403} + CADDY_GLOBAL_OPTIONS: | + email myemail@sample.com + auto_https disable_redirects + debug + WORDPRESS_CONFIG_EXTRA: | + define('WP_SITEURL', 'http://localhost:8099'); + define('WP_HOME', 'http://localhost:8099'); + + volumes: + - ./app:/var/www/html + + depends_on: + - db + tty: true + + db: + image: mariadb:latest + restart: always + ports: + - ${LOCAL_DB_PORT:-3310}:3306 + environment: + MYSQL_DATABASE: ${DB_NAME:-exampledb} + MYSQL_USER: ${DB_USER:-exampleuser} + MYSQL_PASSWORD: ${DB_PASSWORD:-examplepass} + MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-examplepass} + volumes: + - dbwp:/var/lib/mysql \ No newline at end of file From 4f0e7fba2ec9a3936ac374d1eb05f3892f42125d Mon Sep 17 00:00:00 2001 From: Stephen Miracle Date: Tue, 28 May 2024 17:29:24 -0400 Subject: [PATCH 2/2] adding sqlite example. --- examples/sqlite/.gitignore | 1 + examples/sqlite/Dockerfile | 15 +++++++++++++++ examples/sqlite/compose.yaml | 18 +----------------- 3 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 examples/sqlite/.gitignore create mode 100644 examples/sqlite/Dockerfile diff --git a/examples/sqlite/.gitignore b/examples/sqlite/.gitignore new file mode 100644 index 00000000..b80f0bd6 --- /dev/null +++ b/examples/sqlite/.gitignore @@ -0,0 +1 @@ +app diff --git a/examples/sqlite/Dockerfile b/examples/sqlite/Dockerfile new file mode 100644 index 00000000..4251b7a3 --- /dev/null +++ b/examples/sqlite/Dockerfile @@ -0,0 +1,15 @@ +ARG IMAGE_VERSION=beta-1.0.0 + +FROM stephenmiracle/frankenwp:$IMAGE_VERSION + +# Install SQLite +RUN apt-get update && apt-get install -y --no-install-recommends sqlite3 libsqlite3-dev wget + +# Install the SQLite plugin +RUN wget https://downloads.wordpress.org/plugin/sqlite-database-integration.zip -O /usr/src/wordpress/sqlite-database-integration.zip && \ + unzip /usr/src/wordpress/sqlite-database-integration.zip -d /var/www/html/wp-content/mu-plugins/ && \ + rm /usr/src/wordpress/sqlite-database-integration.zip + +RUN cp /var/www/html/wp-content/mu-plugins/sqlite-database-integration/db.copy /var/www/html/wp-content/db.php && \ + sed -i 's/{SQLITE_IMPLEMENTATION_FOLDER_PATH}/\/var\/www\/html\/wp-content\/mu-plugins\/sqlite-database-integration/g' /var/www/html/wp-content/db.php && \ + sed -i 's/{SQLITE_PLUGIN}/WP_PLUGIN_DIR\/SQLITE_MAIN_FILE/g' /var/www/html/wp-content/db.php \ No newline at end of file diff --git a/examples/sqlite/compose.yaml b/examples/sqlite/compose.yaml index 5b834922..55f28b5f 100644 --- a/examples/sqlite/compose.yaml +++ b/examples/sqlite/compose.yaml @@ -10,7 +10,7 @@ services: WORDPRESS_DB_USER: ${DB_USER:-exampleuser} WORDPRESS_DB_PASSWORD: ${DB_PASSWORD:-examplepass} WORDPRESS_DB_NAME: ${DB_NAME:-exampledb} - WORDPRESS_DEBUG: ${WP_DEBUG:-true} + WORDPRESS_DEBUG: ${WP_DEBUG:-false} WORDPRESS_TABLE_PREFIX: ${DB_TABLE_PREFIX:-wp_} CACHE_LOC: ${CACHE_LOC:-/var/www/html/wp-content/cache} TTL: ${TTL:-80000} @@ -22,7 +22,6 @@ services: CADDY_GLOBAL_OPTIONS: | email myemail@sample.com auto_https disable_redirects - debug WORDPRESS_CONFIG_EXTRA: | define('WP_SITEURL', 'http://localhost:8099'); define('WP_HOME', 'http://localhost:8099'); @@ -30,19 +29,4 @@ services: volumes: - ./app:/var/www/html - depends_on: - - db tty: true - - db: - image: mariadb:latest - restart: always - ports: - - ${LOCAL_DB_PORT:-3310}:3306 - environment: - MYSQL_DATABASE: ${DB_NAME:-exampledb} - MYSQL_USER: ${DB_USER:-exampleuser} - MYSQL_PASSWORD: ${DB_PASSWORD:-examplepass} - MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-examplepass} - volumes: - - dbwp:/var/lib/mysql \ No newline at end of file