From 2b6c4336e010ff6ba642d44bb0e11a9ab1f99a65 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Sun, 27 Jan 2019 21:11:54 +0900 Subject: [PATCH] Add woocommerce support --- README.md | 4 +- btcpay-setup.sh | 7 +++- .../docker-fragments/opt-add-woocommerce.yml | 39 +++++++++++++++++++ 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 docker-compose-generator/docker-fragments/opt-add-woocommerce.yml diff --git a/README.md b/README.md index 2f00db2..9f671d5 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,8 @@ You can read [the article](https://medium.com/@BtcpayServer/hosting-btcpay-serve Additionally, there are specific environment variables for some addons: -* `LIBREPATRON_HOST`: If libre patron is activated, The hostname of your libre patron website (eg. `librepatron.example.com`) +* `LIBREPATRON_HOST`: If libre patron is activated with [opt-add-librepatron](docker-compose-generator/docker-fragments/opt-add-librepatron.yml), the hostname of your libre patron website (eg. `librepatron.example.com`) +* `WOOCOMMERCE_HOST`: If woocommerce is activated with [opt-add-woocommerce](docker-compose-generator/docker-fragments/opt-add-woocommerce.yml), the hostname of your woocommerce website (eg. `store.example.com`) # Tooling @@ -162,6 +163,7 @@ Available `BTCPAYGEN_ADDITIONAL_FRAGMENTS` currently are: * [opt-save-memory](docker-compose-generator/docker-fragments/opt-save-memory.yml) will decrease the default dbcache at the expense of longer synchronization time (Useful if your machine is less than 2GB) * [opt-add-btcqbo](docker-compose-generator/docker-fragments/opt-add-btcqbo.yml) will allow you to create an invoice on Quickbooks which include a way for your customer to pay on BTCPay Server (More information on this [github repository](https://github.com/JeffVandrewJr/btcqbo/), this add-on is maintained by [JeffVandrewJr](https://github.com/JeffVandrewJr), see more on [this video](https://www.youtube.com/watch?v=srgwL9ozg6c)) * [opt-add-librepatron](docker-compose-generator/docker-fragments/opt-add-librepatron.yml), for a self-hosted Patreon alternative backed by BTCPay (More information on this [github repository](https://github.com/JeffVandrewJr/patron), this add-on is maintained by [JeffVandrewJr](https://github.com/JeffVandrewJr). +* [opt-add-woocommerce](docker-compose-generator/docker-fragments/opt-add-woocommerce.yml), for a self-hosted woocommerce with BTCPay Server plugin pre installed. You can also create your own [custom fragments](#how-can-i-customize-the-generated-docker-compose-file). diff --git a/btcpay-setup.sh b/btcpay-setup.sh index 4405b5a..4c5f23a 100755 --- a/btcpay-setup.sh +++ b/btcpay-setup.sh @@ -63,7 +63,8 @@ Environment variables: BTCPAYGEN_DOCKER_IMAGE: Allows you to specify a custom docker image for the generator (Default: btcpayserver/docker-compose-generator) BTCPAY_IMAGE: Allows you to specify the btcpayserver docker image to use over the default version. (Default: current stable version of btcpayserver) Add-on specific variables: - LIBREPATRON_HOST: If libre patron is activated, The hostname of your libre patron website (eg. librepatron.example.com) + LIBREPATRON_HOST: If libre patron is activated with opt-add-librepatron, the hostname of your libre patron website (eg. librepatron.example.com) + WOOCOMMERCE_HOST: If woocommerce is activated with opt-add-woocommerce, the hostname of your woocommerce website (eg. store.example.com) END } @@ -140,6 +141,7 @@ echo " Parameters passed: BTCPAY_HOST:$BTCPAY_HOST LIBREPATRON_HOST:$LIBREPATRON_HOST +WOOCOMMERCE_HOST:$WOOCOMMERCE_HOST BTCPAY_HOST_SSHKEYFILE:$BTCPAY_HOST_SSHKEYFILE LETSENCRYPT_EMAIL:$LETSENCRYPT_EMAIL NBITCOIN_NETWORK:$NBITCOIN_NETWORK @@ -218,7 +220,8 @@ LETSENCRYPT_EMAIL=$LETSENCRYPT_EMAIL LIGHTNING_ALIAS=$LIGHTNING_ALIAS BTCPAY_SSHTRUSTEDFINGERPRINTS=$BTCPAY_SSHTRUSTEDFINGERPRINTS BTCPAY_SSHKEYFILE=$BTCPAY_SSHKEYFILE -LIBREPATRON_HOST=$LIBREPATRON_HOST" > $BTCPAY_ENV_FILE +LIBREPATRON_HOST=$LIBREPATRON_HOST +WOOCOMMERCE_HOST=$WOOCOMMERCE_HOST" > $BTCPAY_ENV_FILE echo -e "BTCPay Server docker-compose parameters saved in $BTCPAY_ENV_FILE\n" . /etc/profile.d/btcpay-env.sh diff --git a/docker-compose-generator/docker-fragments/opt-add-woocommerce.yml b/docker-compose-generator/docker-fragments/opt-add-woocommerce.yml new file mode 100644 index 0000000..ae24f63 --- /dev/null +++ b/docker-compose-generator/docker-fragments/opt-add-woocommerce.yml @@ -0,0 +1,39 @@ +version: '3' + +services: + woocommerce: + image: btcpayserver/docker-woocommerce:3.0.5 + environment: + WOOCOMMERCE_HOST: ${WOOCOMMERCE_HOST} + WORDPRESS_DB_HOST: mariadb + WORDPRESS_DB_USER: wordpress + WORDPRESS_DB_PASSWORD: wordpress + LETSENCRYPT_HOST: ${WOOCOMMERCE_HOST} + LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL:-} + VIRTUAL_HOST: ${WOOCOMMERCE_HOST} + VIRTUAL_SERVICE_NAME: "woocommerce" + expose: + - "80" + links: + - mariadb + volumes: + - "woocommerce_html:/var/www/html" + + mariadb: + image: mariadb:10.3 + environment: + MYSQL_ROOT_PASSWORD: wordpressdb + MYSQL_DATABASE: wordpress + MYSQL_USER: wordpress + MYSQL_PASSWORD: wordpress + expose: + - "3306" + volumes: + - "mariadb_datadir:/var/lib/mysql" + + btcpayserver: + environment: + BTCPAY_EXTERNALSERVICES: "WooCommerce:${BTCPAY_PROTOCOL:-https}://${WOOCOMMERCE_HOST};" +volumes: + woocommerce_html: + mariadb_datadir: \ No newline at end of file