Update docker-compose (#863)

This commit is contained in:
Nicolas Dorier 2023-12-26 18:55:47 +09:00 committed by GitHub
parent 885de9496f
commit 1ef9d11738
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 38 additions and 23 deletions

View File

@ -428,17 +428,6 @@ if ! [[ -x "$(command -v docker)" ]] || ! [[ -x "$(command -v docker-compose)" ]
fi fi
docker_update docker_update
if ! [[ -x "$(command -v docker-compose)" ]]; then
if ! [[ "$OSTYPE" == "darwin"* ]] && $HAS_DOCKER; then
echo "Trying to install docker-compose by using the btcpayserver/docker-compose ($(uname -m))"
! [[ -d "dist" ]] && mkdir dist
docker run --rm -v "$(pwd)/dist:/dist" btcpayserver/docker-compose:1.28.6
mv dist/docker-compose /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
rm -rf "dist"
fi
fi
fi fi
if $HAS_DOCKER; then if $HAS_DOCKER; then

View File

@ -47,6 +47,7 @@ services:
bitcoin_rtl: bitcoin_rtl:
image: shahanafarooqui/rtl:0.14.1 image: shahanafarooqui/rtl:0.14.1
container_name: generated_lnd_bitcoin_rtl_1
restart: unless-stopped restart: unless-stopped
environment: environment:
LND_SERVER_URL: http://lnd_bitcoin:8080/v1 LND_SERVER_URL: http://lnd_bitcoin:8080/v1

View File

@ -3,6 +3,7 @@ version: "3"
services: services:
btcpayserver: btcpayserver:
restart: unless-stopped restart: unless-stopped
container_name: generated_btcpayserver_1
image: ${BTCPAY_IMAGE:-btcpayserver/btcpayserver:1.12.3$<BTCPAY_BUILD_CONFIGURATION>?} image: ${BTCPAY_IMAGE:-btcpayserver/btcpayserver:1.12.3$<BTCPAY_BUILD_CONFIGURATION>?}
expose: expose:
- "49392" - "49392"

View File

@ -4,6 +4,7 @@ services:
nbxplorer: nbxplorer:
restart: unless-stopped restart: unless-stopped
container_name: generated_nbxplorer_1
image: nicolasdorier/nbxplorer:2.4.4 image: nicolasdorier/nbxplorer:2.4.4
expose: expose:
- "32838" - "32838"

View File

@ -3,6 +3,7 @@ version: '3'
services: services:
fireflyiii: fireflyiii:
image: fireflyiii/core:latest image: fireflyiii/core:latest
container_name: generated_fireflyiii_1
environment: environment:
- APP_ENV=local - APP_ENV=local
- APP_KEY=MustBe32DropDbAndChangeItIfUWant - APP_KEY=MustBe32DropDbAndChangeItIfUWant

View File

@ -7,6 +7,7 @@ services:
- "tallycoin_connect_datadir:/etc/tallycoin_connect_datadir" - "tallycoin_connect_datadir:/etc/tallycoin_connect_datadir"
tallycoin_connect: tallycoin_connect:
image: "djbooth007/tallycoin_connect:v1.8.0" image: "djbooth007/tallycoin_connect:v1.8.0"
container_name: generated_tallycoin_connect_1
restart: unless-stopped restart: unless-stopped
expose: expose:
- "8123" - "8123"

View File

@ -7,6 +7,7 @@ services:
- "lnd_bitcoin_thub_datadir:/etc/lnd_bitcoin_thub_datadir" - "lnd_bitcoin_thub_datadir:/etc/lnd_bitcoin_thub_datadir"
bitcoin_thub: bitcoin_thub:
image: apotdevin/thunderhub:base-v0.13.29@sha256:ed00149728a77469d39d4e9a9ff699c49a090063db201b4457edaf06211a99e8 image: apotdevin/thunderhub:base-v0.13.29@sha256:ed00149728a77469d39d4e9a9ff699c49a090063db201b4457edaf06211a99e8
container_name: generated_bitcoin_thub_1
restart: unless-stopped restart: unless-stopped
stop_signal: SIGKILL stop_signal: SIGKILL
environment: environment:

View File

@ -21,6 +21,7 @@ services:
mariadb: mariadb:
image: mariadb:10.4 image: mariadb:10.4
container_name : generated_mariadb_1
environment: environment:
MYSQL_ROOT_PASSWORD: wordpressdb MYSQL_ROOT_PASSWORD: wordpressdb
MYSQL_DATABASE: wordpress MYSQL_DATABASE: wordpress

View File

@ -3,6 +3,7 @@ version: "3"
services: services:
postgres: postgres:
restart: unless-stopped restart: unless-stopped
container_name: generated_postgres_1
image: btcpayserver/postgres:13.13 image: btcpayserver/postgres:13.13
command: [ "-c", "random_page_cost=1.0", "-c", "shared_preload_libraries=pg_stat_statements" ] command: [ "-c", "random_page_cost=1.0", "-c", "shared_preload_libraries=pg_stat_statements" ]
environment: environment:

View File

@ -133,6 +133,32 @@ CLOUDFLARE_TUNNEL_TOKEN=$CLOUDFLARE_TUNNEL_TOKEN" > $BTCPAY_ENV_FILE
env | grep ^BWT_ >> $BTCPAY_ENV_FILE || true env | grep ^BWT_ >> $BTCPAY_ENV_FILE || true
} }
docker_compose_set_plugin() {
echo "set 'docker compose' to /usr/local/bin/docker-compose"
plugin_path=$(docker info -f '{{ range .ClientInfo.Plugins }}{{ if eq .Name "compose" }}{{ .Path }}{{ end }}{{ end }}' || echo '/usr/libexec/docker/cli-plugins/docker-compose')
if [[ "$plugin_path" ]] && [ -f "$plugin_path" ]; then
rm -f "$plugin_path"
ln -s /usr/local/bin/docker-compose "$plugin_path"
fi
}
docker_compose_update() {
compose_version="2.23.3"
if ! [[ -x "$(command -v docker-compose)" ]] || [[ "$(docker-compose version --short)" != "$compose_version" ]]; then
if ! [[ "$OSTYPE" == "darwin"* ]] && $HAS_DOCKER; then
echo "Trying to install docker-compose by using docker/compose-bin ($(uname -m))"
! [[ -d "dist" ]] && mkdir dist
container=$(docker create docker/compose-bin:v$compose_version /docker-compose)
docker cp "$container:/docker-compose" "dist/docker-compose"
docker rm "$container"
mv dist/docker-compose /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
rm -rf "dist"
docker_compose_set_plugin
fi
fi
}
docker_update() { docker_update() {
if [[ "$(uname -m)" == "armv7l" ]] && cat "/etc/os-release" 2>/dev/null | grep -q "VERSION_CODENAME=buster" 2>/dev/null; then if [[ "$(uname -m)" == "armv7l" ]] && cat "/etc/os-release" 2>/dev/null | grep -q "VERSION_CODENAME=buster" 2>/dev/null; then
if [[ "$(apt list libseccomp2 2>/dev/null)" == *" 2.3"* ]]; then if [[ "$(apt list libseccomp2 2>/dev/null)" == *" 2.3"* ]]; then
@ -176,17 +202,17 @@ docker_update() {
apt-get update apt-get update
apt-get install --only-upgrade -y docker-ce docker-ce-cli containerd.io apt-get install --only-upgrade -y docker-ce docker-ce-cli containerd.io
fi fi
docker_compose_set_plugin
fi fi
docker_compose_update
} }
btcpay_up() { btcpay_up() {
pushd . > /dev/null pushd . > /dev/null
cd "$(dirname "$BTCPAY_ENV_FILE")" cd "$(dirname "$BTCPAY_ENV_FILE")"
docker-compose -f $BTCPAY_DOCKER_COMPOSE up --remove-orphans -d -t "${COMPOSE_HTTP_TIMEOUT:-180}" docker-compose -f $BTCPAY_DOCKER_COMPOSE up --remove-orphans -d -t "${COMPOSE_HTTP_TIMEOUT:-180}"
# Depending on docker-compose, either the timeout does not work, or "compose -d and --timeout cannot be combined"
if ! [ $? -eq 0 ]; then
docker-compose -f $BTCPAY_DOCKER_COMPOSE up --remove-orphans -d
fi
popd > /dev/null popd > /dev/null
} }
@ -201,10 +227,6 @@ btcpay_down() {
pushd . > /dev/null pushd . > /dev/null
cd "$(dirname "$BTCPAY_ENV_FILE")" cd "$(dirname "$BTCPAY_ENV_FILE")"
docker-compose -f $BTCPAY_DOCKER_COMPOSE down -t "${COMPOSE_HTTP_TIMEOUT:-180}" docker-compose -f $BTCPAY_DOCKER_COMPOSE down -t "${COMPOSE_HTTP_TIMEOUT:-180}"
# Depending on docker-compose, the timeout does not work.
if ! [ $? -eq 0 ]; then
docker-compose -f $BTCPAY_DOCKER_COMPOSE down
fi
popd > /dev/null popd > /dev/null
} }
@ -212,10 +234,6 @@ btcpay_restart() {
pushd . > /dev/null pushd . > /dev/null
cd "$(dirname "$BTCPAY_ENV_FILE")" cd "$(dirname "$BTCPAY_ENV_FILE")"
docker-compose -f $BTCPAY_DOCKER_COMPOSE restart -t "${COMPOSE_HTTP_TIMEOUT:-180}" docker-compose -f $BTCPAY_DOCKER_COMPOSE restart -t "${COMPOSE_HTTP_TIMEOUT:-180}"
# Depending on docker-compose, the timeout does not work.
if ! [ $? -eq 0 ]; then
docker-compose -f $BTCPAY_DOCKER_COMPOSE restart
fi
btcpay_up btcpay_up
popd > /dev/null popd > /dev/null
} }