Extra health checks and route qbittorrent through VPN

This commit is contained in:
Shaun Collins
2026-03-13 12:40:46 +00:00
committed by shaun collins
parent a0530fb095
commit aa064c3dbc
3 changed files with 67 additions and 37 deletions
+22 -6
View File
@@ -3,8 +3,10 @@ services:
image: cloudreve/cloudreve:latest image: cloudreve/cloudreve:latest
container_name: cloudreve-backend container_name: cloudreve-backend
depends_on: depends_on:
- postgresql postgresql:
- redis condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped restart: unless-stopped
ports: ports:
- "5212:5212" - "5212:5212"
@@ -19,11 +21,14 @@ services:
- CR_CONF_Redis.Server=redis:6379 - CR_CONF_Redis.Server=redis:6379
volumes: volumes:
- "${DATA_PATH}:/cloudreve/data" - "${DATA_PATH}:/cloudreve/data"
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:5212/api/v3/site/ping"]
interval: 30s
timeout: 5s
start_period: 40s
retries: 3
postgresql: postgresql:
# Best practice: Pin to major version.
# NOTE: For major version jumps:
# backup & consult https://www.postgresql.org/docs/current/pgupgrade.html
image: postgres:17 image: postgres:17
container_name: postgresql container_name: postgresql
restart: unless-stopped restart: unless-stopped
@@ -33,6 +38,12 @@ services:
- POSTGRES_HOST_AUTH_METHOD=trust - POSTGRES_HOST_AUTH_METHOD=trust
volumes: volumes:
- database_postgres:/var/lib/postgresql/data - database_postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U cloudreve"]
interval: 10s
timeout: 5s
start_period: 30s
retries: 5
redis: redis:
image: redis:latest image: redis:latest
@@ -40,8 +51,13 @@ services:
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- redis_data:/data - redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
start_period: 30s
retries: 5
volumes: volumes:
# backend_data:
database_postgres: database_postgres:
redis_data: redis_data:
+15 -2
View File
@@ -1,4 +1,3 @@
services: services:
gitea: gitea:
image: gitea/gitea:latest image: gitea/gitea:latest
@@ -22,6 +21,15 @@ services:
ports: ports:
- "3001:3000" - "3001:3000"
- "222:22" - "222:22"
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/healthz"]
interval: 30s
timeout: 5s
start_period: 40s
retries: 3
depends_on:
db:
condition: service_healthy
db: db:
image: mysql:8 image: mysql:8
@@ -37,7 +45,12 @@ services:
- gitea - gitea
volumes: volumes:
- ./mysql:/var/lib/mysql - ./mysql:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
start_period: 30s
retries: 5
networks: networks:
gitea: gitea:
+30 -29
View File
@@ -120,33 +120,6 @@ services:
networks: networks:
- lingen - lingen
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
container_name: qbittorrent
ports:
- "8080:8080"
- "6881:6881"
- "6881:6881/udp"
environment:
- PUID=${PUID}
- PGID=${PGID}
- TZ=${TZ}
- WEBUI_PORT=8080
volumes:
- ./Radarr/config:/config
- ${TVSHOWS}:/data/tvshows
- ${MOVIES}:/data/movies
- ${DOWNLOADS}:/data/downloads
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080"]
start_period: 30s
timeout: 5s
interval: 30s
retries: 3
restart: unless-stopped
networks:
- lingen
flaresolverr: flaresolverr:
image: ghcr.io/flaresolverr/flaresolverr:latest image: ghcr.io/flaresolverr/flaresolverr:latest
container_name: flaresolverr container_name: flaresolverr
@@ -187,7 +160,7 @@ services:
cap_drop: cap_drop:
- ALL - ALL
healthcheck: healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:3002/api/health" ] test: ["CMD-SHELL", "wget -q -O- http://localhost:3000/api/health || exit 1"]
interval: 30s interval: 30s
timeout: 5s timeout: 5s
start_period: 10s start_period: 10s
@@ -211,8 +184,11 @@ services:
ports: ports:
- "51820:51820/udp" - "51820:51820/udp"
- "8000:8000" - "8000:8000"
- "8080:8080" # Add qBittorrent WebUI port
- "6881:6881" # Add qBittorrent listening port
- "6881:6881/udp" # Add qBittorrent listening port UDP
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/v1/vpn/status"] test: ["CMD-SHELL", "wget -q -O- http://localhost:8000/v1/vpn/status || exit 1"]
start_period: 30s start_period: 30s
timeout: 5s timeout: 5s
interval: 30s interval: 30s
@@ -221,6 +197,31 @@ services:
- lingen - lingen
restart: unless-stopped restart: unless-stopped
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
container_name: qbittorrent
environment:
- PUID=${PUID}
- PGID=${PGID}
- TZ=${TZ}
- WEBUI_PORT=8080
volumes:
- ./Radarr/config:/config
- ${TVSHOWS}:/data/tvshows
- ${MOVIES}:/data/movies
- ${DOWNLOADS}:/data/downloads
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080"]
start_period: 30s
timeout: 5s
interval: 30s
retries: 3
restart: unless-stopped
network_mode: "container:gluetun"
depends_on:
gluetun:
condition: service_healthy
networks: networks:
lingen: lingen:
driver: bridge driver: bridge