Skip to content

Commit

Permalink
Merge pull request #43 from soup-bowl/release-1.2
Browse files Browse the repository at this point in the history
Release 1.2
  • Loading branch information
soup-bowl committed Sep 12, 2021
2 parents f6f12e3 + 004970b commit 9093cf0
Show file tree
Hide file tree
Showing 16 changed files with 856 additions and 342 deletions.
11 changes: 10 additions & 1 deletion .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
FROM wordpress:php7.4-apache

RUN curl https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar --output /usr/bin/wp \
&& chmod +X /usr/bin/wp \
&& chmod 766 /usr/bin/wp

RUN pecl install xdebug-3.0.1
ADD ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini

ADD ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
ADD ./quickstart.sh /usr/bin/quickstart
ADD ./multisite-htaccess /opt/wpss/htaccess

RUN chmod +x /usr/bin/quickstart

EXPOSE 9003
19 changes: 19 additions & 0 deletions .docker/multisite-htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# BEGIN WordPress Multisite
# Using subfolder network type: https://wordpress.org/support/article/htaccess/#multisite

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

# END WordPress Multisite
6 changes: 6 additions & 0 deletions .docker/quickstart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#! /bin/bash
wp core install --url="localhost" --title="Development" --admin_user="admin" --admin_password="password" --admin_email="code@example.com" --skip-email --allow-root
if [ "$1" == "ms" ]; then
rm /var/www/html/.htaccess && cp /opt/wpss/htaccess /var/www/html/.htaccess
wp core multisite-install --title="abc" --admin_email="code@soupbowl.io" --allow-root
fi
33 changes: 33 additions & 0 deletions .docker/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Development quickstart with Docker
This plugin has designed to be ready to go with [Docker] (using [docker-compose][compose]) very quickly. All you need is Docker and docker-compose to be installed on **any platform**.

If you're using **Visual Studio Code**, the [Docker extension][ext] removes a lot of the CLI steps.

## Start-up
Simply run the following code in the root of the cloned Git directory.

```
docker-compose up --build -d
```
This does the following:
* Reads the docker-compose.yml root file to see what images and setups we need (web, db, mail mocker).
* `build` instructs compose to re-build the custom images. Not always needed, but essential if you change the Dockerfile.
* `d` returns the TTL back to you. If omitted, you will start seeing on-the-fly logs from each container.

If no errors occur, you'll now have the following local bindings:
* WordPress on port 80 & 443 (default) - visting http://localhost should load up the WordPress installer.
* Database with an auto-login phpMyAdmin instance on http://localhost:8082.
* Mail mocker, with the SMTP server on port 1025 (8083 for outside-container usage), and the GUI on http://localhost:8081.

## Quickstart Script
To speed this up even more, I've included a small script that interfaces with [WP CLI][cli] to bypass the 5 minute install process. This will give you a basic functioning WordPress site with typically default development installation choices. The username is **admin** and the password is **password**.

* For a regular install, run `docker-compose exec www quickstart`.
* For a multisite instance, run `docker-compose exec www quickstart ms`.

This **does not setup SMTP**, to avoid impeding testing procedures. You'll still need to do that.

[docker]: https://www.docker.com/
[compose]: https://docs.docker.com/compose/
[ext]: https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker
[cli]: https://wp-cli.org/
11 changes: 1 addition & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@
"description": "Gives WordPress the missing SMTP configuration panel it needed.",
"autoload": {
"classmap": [
"src/class-options.php",
"src/settings/class-settings.php",
"src/settings/class-mailview.php",
"src/mail/class-mail.php",
"src/mail/class-mailtest.php",
"src/mail/class-maildisable.php",
"src/log/class-log.php",
"src/log/class-logservice.php",
"src/log/class-logtable.php",
"src/log/class-logattachment.php"
"src"
]
},
"require-dev": {
Expand Down
Loading

0 comments on commit 9093cf0

Please sign in to comment.