diff --git a/.env b/.env index ee32ba6..44537e7 100644 --- a/.env +++ b/.env @@ -128,6 +128,7 @@ AUTOSYNC_HOSTNAME=autosync.${DOMAIN} BAZARR_HOSTNAME=bazarr.${DOMAIN} BAZARR4K_HOSTNAME=4k.bazarr.${DOMAIN} BESZEL_HOSTNAME=beszel.${DOMAIN} +BITMAGNET_HOSTNAME=bitmagnet.${DOMAIN} COMET_HOSTNAME=comet.${DOMAIN} DASHDOT_HOSTNAME=dash.${DOMAIN} DEBRIDAV_HOSTNAME=debridav.${DOMAIN} diff --git a/apps/bitmagnet/.env b/apps/bitmagnet/.env new file mode 100644 index 0000000..9cdc402 --- /dev/null +++ b/apps/bitmagnet/.env @@ -0,0 +1,16 @@ +# You will need to open the BitTorrent port on your host machine. +# Open port 3334 for both TCP and UDP. + +# You should have already setup gluetun as Bitmagnet is pre-configured to run within the gluetun container's network. +# It uses a separate gluetun container but uses the same config. If you'd like to use a separate gluetun configuration, then create a different +# .env file here called .gluetun.env and change the path under services.bitmagnet_vpn.env_file to .gluetun.env + +# Provide your TMDB API Key here. It is recommneded but not required: https://bitmagnet.io/setup/configuration.html#obtaining-a-tmdb-api-key +TMDB_API_KEY= + +# All other configuration options can be found here: https://bitmagnet.io/setup/configuration.html +# But it is not required to alter anything else. Once it is running you can use the following URLs to access BitMagnet: + +# Internal URL: http://bitmagnet:3333 (e.g. AIOStreams' BUILTIN_BITMAGNET_URL and StremThru's STREMTHRU_INTEGRATION_BITMAGNET_BASE_URL) +# Database URI: postgres://bitmagnet:bitmagnet@bitmagnet_postgres:5432/bitmagnet (StremThru's STREMTHRU_INTEGRATION_BITMAGNET_DATABASE_URI) +# Web UI: https://bitmagnet.${DOMAIN} diff --git a/apps/bitmagnet/compose.yaml b/apps/bitmagnet/compose.yaml new file mode 100644 index 0000000..fbe2653 --- /dev/null +++ b/apps/bitmagnet/compose.yaml @@ -0,0 +1,104 @@ +services: + bitmagnet: + container_name: bitmagnet + image: ghcr.io/bitmagnet-io/bitmagnet:latest + volumes: + - ${DOCKER_APP_DIR}/bitmagnet/config:/root/.config/bitmagnet + restart: unless-stopped + environment: + # Enable logging to rotating files for ingest to Loki: + - LOG_FILE_ROTATOR_ENABLED=false + - POSTGRES_HOST=bitmagnet_postgres + - POSTGRES_PASSWORD=bitmagnet + - POSTGRES_DB=bitmagnet + - POSTGRES_USER=bitmagnet + - TMDB_API_KEY=${TMDB_API_KEY} + network_mode: service:bitmagnet_vpn + depends_on: + bitmagnet_postgres: + condition: service_healthy + bitmagnet_vpn: + condition: service_healthy + command: + - worker + - run + # Run all workers: + - --all + # Or enable individual workers: + # - --keys=http_server + # - --keys=queue_server + # - --keys=dht_crawler + + bitmagnet_vpn: + container_name: bitmagnet_vpn + image: qmcgaw/gluetun + restart: unless-stopped + cap_add: + - NET_ADMIN + devices: + - /dev/net/tun:/dev/net/tun + ports: + # The bitmagnet ports must be exposed by the gluetun container: + # - "3333:3333" # web UI + # BitTorrent ports: + - "3334:3334/tcp" + - "3334:3334/udp" + env_file: + - ${DOCKER_APP_DIR}/gluetun/.env + labels: + - "traefik.enable=true" + - "traefik.http.routers.bitmagnet.rule=Host(`${BITMAGNET_HOSTNAME}`)" + - "traefik.http.routers.bitmagnet.entrypoints=websecure" + - "traefik.http.routers.bitmagnet.tls=true" + - "traefik.http.routers.bitmagnet.tls.certresolver=letsencrypt" + - "traefik.http.routers.bitmagnet.middlewares=authelia@docker" + - "traefik.http.services.bitmagnet.loadbalancer.server.port=3333" + volumes: + - ${DOCKER_DATA_DIR}/gluetun:/gluetun + healthcheck: + test: ["CMD", "/gluetun-entrypoint", "healthcheck"] + interval: 60s + timeout: 5s + retries: 3 + start_period: 1m + extra_hosts: + - "bitmagnet_postgres:192.168.55.11" + networks: + bitmagnet: + ipv4_address: 192.168.55.10 + default: + + hostname: bitmagnet + profiles: + - gluetun + - all + + bitmagnet_postgres: + image: postgres:16-alpine + container_name: bitmagnet_postgres + volumes: + - ${DOCKER_DATA_DIR}/bitmagnet/db:/var/lib/postgresql/data + shm_size: 1g + restart: unless-stopped + environment: + - POSTGRES_PASSWORD=bitmagnet + - POSTGRES_DB=bitmagnet + - POSTGRES_USER=bitmagnet + networks: + bitmagnet: + ipv4_address: 192.168.55.11 + default: + healthcheck: + test: ["CMD-SHELL", "pg_isready", "-U", "bitmagnet", "-d", "bitmagnet"] + interval: 10s + start_period: 20s + + +networks: + bitmagnet: + driver: bridge + ipam: + driver: default + config: + - subnet: 192.168.55.0/24 + gateway: 192.168.55.1 \ No newline at end of file diff --git a/apps/cloudflare-ddns/compose.yaml b/apps/cloudflare-ddns/compose.yaml index 7c8a3aa..72f2463 100644 --- a/apps/cloudflare-ddns/compose.yaml +++ b/apps/cloudflare-ddns/compose.yaml @@ -27,6 +27,7 @@ services: ${BAZARR_HOSTNAME}, ${BAZARR4K_HOSTNAME}, ${BESZEL_HOSTNAME}, + ${BITMAGNET_HOSTNAME}, ${COMET_HOSTNAME}, ${DASHDOT_HOSTNAME}, ${DEBRIDAV_HOSTNAME}, diff --git a/compose.yaml b/compose.yaml index d186457..d2404bd 100644 --- a/compose.yaml +++ b/compose.yaml @@ -13,6 +13,7 @@ include: - apps/autosync/compose.yaml - apps/bazarr/compose.yaml - apps/beszel/compose.yaml + - apps/bitmagnet/compose.yaml - apps/borgmatic/compose.yaml - apps/byparr/compose.yaml - apps/cloudflare-ddns/compose.yaml