add build scripts for custom docker-compose
This commit is contained in:
51
README.md
51
README.md
@@ -71,3 +71,54 @@ Wait a little bit, then you can now browse `https://btcpay.example.com/`.
|
||||
|
||||
The files in `Production` and `Production-NoReverseProxy` are generated by a dotnet program located in `docker-compose-generator`.
|
||||
It is meant to generate a wide range a configuration from `docker-compose-generator/docker-fragments` without repeating myself.
|
||||
|
||||
# No docker-compose suit my need, what should I do?
|
||||
|
||||
All `docker-compose` files in [Production](Production) and [Production-NoReverseProxy](Production-NoReverseProxy) are generated by running the [build-pregen.sh](build-pregen.sh) (or [build-pregen.ps1](build-pregen.ps1)) scripts from the fragments located in [docker-compose-generator/docker-fragments](docker-compose-generator/docker-fragments).
|
||||
|
||||
The pre-generated `docker-compose` files cover `btc`, `ltc`, `clightning` for configuration with or without `nginx `reverse proxy.
|
||||
|
||||
If you want any other configuration, you need to run [build.sh](build.sh) (or [build.ps1](build.ps1)) with environment variables correctly set.
|
||||
|
||||
To configure your custom docker-compose, the following environment variables are supported:
|
||||
|
||||
* `BTCPAYGEN_CRYPTO1` to `BTCPAYGEN_CRYPTO9`: Specify support for a crypto currency. (Valid value: `btc`, `ltc`)
|
||||
* `BTCPAYGEN_REVERSEPROXY`: Specify the reverse proxy to use (Valid value: `nginx`, `none`)
|
||||
* `BTCPAYGEN_LIGHTNING`: Specify the lightning network implementation (Valid value: `clightning`, `none`)
|
||||
* `BTCPAYGEN_SUBNAME`: The sub name of the generated docker-compose file, where the full name will be `Generated/docker-compose.SUBNAME.yml` (Default: `generated`)
|
||||
|
||||
Then, running [build.sh](build.sh) (or [build.ps1](build.ps1)) will then generate a `docker-compose.generated.yml` in the root folder of this repository.
|
||||
For example, if you want `btc` and `ltc` support with `nginx` and `clightning` inside `Generate/docker-compose.custom.yml`:
|
||||
|
||||
On Windows:
|
||||
|
||||
```
|
||||
Invoke-Command {
|
||||
$BTCPAYGEN_CRYPTO1="btc"
|
||||
$BTCPAYGEN_CRYPTO2="ltc"
|
||||
$BTCPAYGEN_REVERSEPROXY="nginx"
|
||||
$BTCPAYGEN_LIGHTNING="clightning"
|
||||
$BTCPAYGEN_SUBNAME="custom"
|
||||
. .\build.ps1
|
||||
}
|
||||
```
|
||||
|
||||
On Linux:
|
||||
|
||||
```
|
||||
BTCPAYGEN_CRYPTO1=btc \
|
||||
BTCPAYGEN_CRYPTO2=ltc \
|
||||
BTCPAYGEN_REVERSEPROXY=nginx \
|
||||
BTCPAYGEN_LIGHTNING=cligthning \
|
||||
BTCPAYGEN_SUBNAME=custom \
|
||||
./build.sh
|
||||
```
|
||||
|
||||
# How to extend with my own crypto?
|
||||
|
||||
1. Support for your crypto on [NBitcoin](https://github.com/MetacoSA/NBitcoin/tree/master/NBitcoin.Altcoins)/[NBxplorer](https://github.com/dgarage/NBXplorer)/[BTCPay Server](https://github.com/btcpayserver/btcpayserver). (Take example on other coins)
|
||||
2. Create your own docker image ([Example for BTC](https://hub.docker.com/r/nicolasdorier/docker-bitcoin/))
|
||||
3. Create a docker-compose fragment ([Example for BTC](docker-compose-generator/docker-fragments/bitcoin.yml))
|
||||
4. Add your Crypto Definition ([Example for BTC](docker-compose-generator/CryptoDefinition.cs))
|
||||
|
||||
Congratulation!
|
||||
Reference in New Issue
Block a user