-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #897 from matomo-org/woocommerce-local
add woocommerce setup to local dev environment
- Loading branch information
Showing
10 changed files
with
118 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,9 +52,9 @@ The first time the container starts it will compile php extensions within the co | |
and set it up. | ||
|
||
After starting the container, visit `http://localhost:3000/` to see the list of available wordpress versions. | ||
Pick one, and it will take you to the Wordpress installer. | ||
Pick one, and it will take you to Wordpress. | ||
|
||
After installing Wordpress, go to the plugins page and activate Matomo for Wordpress. | ||
Go to wp-login.php, then enter `root` for the user name and `pass` for the password and login. | ||
|
||
Note: docker related files, such as the downloaded wordpress and database files, will be stored in a new folder named `./docker`. As long | ||
as you are using this local dev environment, you should not delete this folder. | ||
|
@@ -71,6 +71,10 @@ variables are supported: | |
- `WP_PLUGINS` - a list of plugin/version pairs like "my-plugin my-other-plugin:1.2.3". For each item, wp-cli will attempt to download and activate the plugin. | ||
This is the same format as the Active Plugins entry in the System Report, so you could copy that value to this environment variable to quickly (or more quickly) | ||
replicate a user's setup. | ||
- `WP_ADMIN_USER` - the admin wordpress username, defaults to 'root'. This variable is only used when installing wordpress. It shouldn't be changed afterwards, unless doing a fresh install. | ||
- `WP_ADMIN_EMAIL` - the admin user's email, defaults to '[email protected]'. This variable is only used when installing wordpress. It shouldn't be changed afterwards, unless doing a fresh install. | ||
- `WOOCOMMERCE` - if set, installs and sets up woocommerce. This includes setting up a payment gateway with stripe and adding some test products. (Note: you will still have to go through woocommerce | ||
onboarding as there is no way to disable it, and that means you will have to enter your stripe test keys manually when setting up the payment gateway.) | ||
|
||
**Running wp-cli** | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,23 +4,36 @@ | |
# - BACKEND ('mariadb' or 'mysql', defaults to 'mariadb') | ||
# - WORDPRESS_VERSION (defaults to latest (defined below)) | ||
# - PORT (the port to expose wordpress on, defaults to 3000) | ||
# - WP_ADMIN_USER (the admin wordpress username, defaults to 'root') | ||
# - WP_ADMIN_EMAIL (the admin user's email, defaults to '[email protected]') | ||
# - WOOCOMMERCE (if set, installs and sets up woocommerce) | ||
# - STRIPE_PUBLISHABLE_KEY (the test publishable key to use with a woocommerce install) | ||
# - STRIPE_SECRET_KEY (the test secret key to use with a woocommerce install) | ||
|
||
services: | ||
# basic apache service | ||
wordpress: | ||
image: "php:${PHP_VERSION:-8.1}-apache" | ||
build: | ||
context: ./scripts | ||
dockerfile: ./Dockerfile.local | ||
args: | ||
PHP_VERSION: "$PHP_VERSION" | ||
PHP_TYPE: apache | ||
volumes: | ||
- ./docker/wordpress:/var/www/html | ||
- "./docker/php-${PHP_VERSION:-8.1}/php:/usr/src/php" | ||
- "./docker/php-${PHP_VERSION:-8.1}/extensions:/usr/local/lib/php/extensions" | ||
- "./docker/php-${PHP_VERSION:-8.1}/conf:/usr/local/etc/php/conf.d" | ||
- .:/var/www/html/matomo-for-wordpress | ||
- /var/www/html/matomo-for-wordpress/app/tmp | ||
- ./scripts/local-dev-entrypoint.sh:/usr/src/entrypoint.sh | ||
- ./docker/wp-cli:/.wp-cli | ||
ports: | ||
- "${PORT:-3000}:80" | ||
environment: | ||
WP_DB_HOST: "${BACKEND:-mariadb}" | ||
WOOCOMMERCE: "${WOOCOMMERCE:-}" | ||
STRIPE_PUBLISHABLE_KEY: "$STRIPE_PUBLISHABLE_KEY" | ||
STRIPE_SECRET_KEY: "$STRIPE_SECRET_KEY" | ||
WP_ADMIN_USER: "${WP_ADMIN_USER:-root}" | ||
WP_ADMIN_EMAIL: "${WP_ADMIN_EMAIL:[email protected]}" | ||
entrypoint: /usr/src/entrypoint.sh | ||
depends_on: | ||
- "${BACKEND:-mariadb}" | ||
|
@@ -30,17 +43,25 @@ services: | |
|
||
# nginx service | ||
fpm: | ||
image: "php:${PHP_VERSION:-8.1}-fpm" | ||
build: | ||
context: . | ||
dockerfile: ./scripts/Dockerfile.local | ||
args: | ||
PHP_VERSION: "$PHP_VERSION" | ||
PHP_TYPE: fpm | ||
volumes: | ||
- ./docker/wordpress:/var/www/html | ||
- "./docker/php-${PHP_VERSION:-8.1}/php:/usr/src/php" | ||
- "./docker/php-${PHP_VERSION:-8.1}/extensions:/usr/local/lib/php/extensions" | ||
- "./docker/php-${PHP_VERSION:-8.1}/conf:/usr/local/etc/php/conf.d" | ||
- .:/var/www/html/matomo-for-wordpress | ||
- /var/www/html/matomo-for-wordpress/app/tmp | ||
- ./scripts/local-dev-entrypoint.sh:/usr/src/entrypoint.sh | ||
- ./docker/wp-cli:/.wp-cli | ||
environment: | ||
WP_DB_HOST: "${BACKEND:-mariadb}" | ||
WOOCOMMERCE: "$WOOCOMMERCE" | ||
STRIPE_PUBLISHABLE_KEY: "$STRIPE_PUBLISHABLE_KEY" | ||
STRIPE_SECRET_KEY: "$STRIPE_SECRET_KEY" | ||
WP_ADMIN_USER: "${WP_ADMIN_USER:-root}" | ||
WP_ADMIN_EMAIL: "${WP_ADMIN_EMAIL:[email protected]}" | ||
entrypoint: /usr/src/entrypoint.sh | ||
depends_on: | ||
- "${BACKEND:-mariadb}" | ||
|
@@ -64,18 +85,27 @@ services: | |
|
||
# service for running wp-cli | ||
wp: | ||
image: "php:${PHP_VERSION:-8.1}-apache" | ||
build: | ||
context: ./scripts | ||
dockerfile: ./Dockerfile.local | ||
args: | ||
PHP_VERSION: "$PHP_VERSION" | ||
PHP_TYPE: apache | ||
volumes: | ||
- ./docker/wordpress:/var/www/html | ||
- "./docker/php-${PHP_VERSION:-8.1}/php:/usr/src/php" | ||
- "./docker/php-${PHP_VERSION:-8.1}/extensions:/usr/local/lib/php/extensions" | ||
- "./docker/php-${PHP_VERSION:-8.1}/conf:/usr/local/etc/php/conf.d" | ||
- .:/var/www/html/matomo-for-wordpress | ||
- /var/www/html/matomo-for-wordpress/app/tmp | ||
- ./docker/wp-cli:/.wp-cli | ||
ports: | ||
- "${PORT:-3000}:80" | ||
environment: | ||
WP_DB_HOST: "${BACKEND:-mariadb}" | ||
WOOCOMMERCE: "$WOOCOMMERCE" | ||
STRIPE_PUBLISHABLE_KEY: "$STRIPE_PUBLISHABLE_KEY" | ||
STRIPE_SECRET_KEY: "$STRIPE_SECRET_KEY" | ||
WP_ADMIN_USER: "${WP_ADMIN_USER:-root}" | ||
WP_ADMIN_EMAIL: "${WP_ADMIN_EMAIL:[email protected]}" | ||
PAGER: 'more' | ||
user: "${UID:-1000}:${GID:-1000}" | ||
entrypoint: "/var/www/html/wp-cli.phar --path=/var/www/html/${WORDPRESS_VERSION:-6.3.1}" | ||
depends_on: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ARG PHP_VERSION=8.1 | ||
ARG PHP_TYPE=apache | ||
FROM "php:$PHP_VERSION-$PHP_TYPE" AS base | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends libfreetype6 zlib1g-dev libjpeg-dev libpng-dev | ||
|
||
RUN docker-php-ext-install mysqli pdo pdo_mysql gd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Product Image Attributions | ||
|
||
ceiling_fan.jpg | ||
|
||
"ceiling fan for bedroom" by mothaibaa01 is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/?ref=openverse. | ||
|
||
spotlight.jpg | ||
|
||
"Isometric Spotlight" by aiiiidan is licensed under CC BY 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by/2.0/?ref=openverse. | ||
|
||
film_projector.jpg | ||
|
||
"Film Projector Lens" by DanielSTL is licensed under CC BY 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by/2.0/?ref=openverse. | ||
|
||
monitors.jpg | ||
|
||
"Arial" by Mr. Riegel is licensed under CC BY 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by/2.0/?ref=openverse. | ||
|
||
tripod.jpg | ||
|
||
"Tripod." by MIKI Yoshihito. (#mikiyoshihito) is licensed under CC BY 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by/2.0/?ref=openverse. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.