Skip to content

Commit

Permalink
Merge pull request #21 from StephenMiracle/feature/sqlite-example
Browse files Browse the repository at this point in the history
Creating example use with SQLite plugin
  • Loading branch information
StephenMiracle authored May 28, 2024
2 parents 0222091 + 4f0e7fb commit 5ce4f86
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/sqlite/.env.sample
Original file line number Diff line number Diff line change
@@ -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_
1 change: 1 addition & 0 deletions examples/sqlite/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
app
15 changes: 15 additions & 0 deletions examples/sqlite/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
32 changes: 32 additions & 0 deletions examples/sqlite/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
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:-false}
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
WORDPRESS_CONFIG_EXTRA: |
define('WP_SITEURL', 'http://localhost:8099');
define('WP_HOME', 'http://localhost:8099');
volumes:
- ./app:/var/www/html

tty: true

0 comments on commit 5ce4f86

Please sign in to comment.