### Docker Network Configuration and Traefik Routing Source: https://context7.com/viren070/docker-compose-template/llms.txt Demonstrates Docker network setup using a .env file for project name and network configuration. Includes commands to inspect networks and shows example Traefik labels for routing external traffic to services based on hostnames. ```bash # Network configuration in .env COMPOSE_PROJECT_NAME=aio DOCKER_NETWORK=aio_network DOCKER_NETWORK_EXTERNAL=false # View network docker network ls | grep aio docker network inspect aio_network # All services communicate via container names: # - http://traefik:80 # - http://authelia:9091 # - http://plex:32400 # - http://overseerr:5055 # - http://sonarr:8989 # - http://radarr:7878 # External access is routed through Traefik based on Host() rules # Example service labels for network routing: labels: - "traefik.enable=true" - "traefik.http.routers.service-name.rule=Host(`subdomain.example.com`)" - "traefik.http.routers.service-name.entrypoints=websecure" - "traefik.http.routers.service-name.tls.certresolver=letsencrypt" - "traefik.http.services.service-name.loadbalancer.server.port=8080" ``` -------------------------------- ### Starting and Managing Docker Compose Services Source: https://context7.com/viren070/docker-compose-template/llms.txt Commands for deploying, verifying, and managing services using Docker Compose. This includes starting core infrastructure, checking service status, viewing logs, enabling specific service profiles, and stopping all services. ```bash # Start core infrastructure (Traefik + Authelia) docker compose --profile required up -d # Verify services are running docker compose ps # Check logs docker compose logs -f traefik authelia # Expected output: # ✔ Container authelia_postgres Started # ✔ Container authelia_redis Started # ✔ Container authelia Started # ✔ Container traefik Started # Add specific services by profile COMPOSE_PROFILES="required,plex,sonarr,radarr,overseerr" # Or enable all services COMPOSE_PROFILES="all" # Deploy with updated profiles docker compose up -d ``` ```bash # Start specific profiles via environment variable export COMPOSE_PROFILES="required,plex,overseerr" docker compose up -d # Override with command-line profiles docker compose --profile sonarr --profile radarr up -d # Restart a specific profile docker compose --profile plex restart # View logs for specific profile docker compose --profile overseerr logs -f # Stop all services docker compose down # Stop and remove volumes docker compose down -v ``` -------------------------------- ### Start All Services with Docker Compose - Shell Source: https://github.com/viren070/docker-compose-template/blob/main/README.md This command starts all services defined in the Docker Compose configuration, respecting the profiles specified in the .env file. It runs the services in detached mode (-d). Ensure COMPOSE_PROFILES is set in the .env file for services to start. ```shell docker compose up -d ``` -------------------------------- ### Start Required Services with Docker Compose - Shell Source: https://github.com/viren070/docker-compose-template/blob/main/README.md This command starts the essential services (Authelia and Traefik) defined in the 'required' profile of the Docker Compose configuration. It runs the services in detached mode (-d). ```shell docker compose --profile required up -d ``` -------------------------------- ### Configure Sonarr TV Show Management with Docker Compose Source: https://context7.com/viren070/docker-compose-template/llms.txt This Docker Compose snippet defines the setup for Sonarr, a TV show management application. It specifies the image, container name, restart policy, environment variables for PUID, PGID, and timezone, and mounts volumes for configuration and media storage. Traefik is used to expose Sonarr via a defined hostname. ```yaml services: sonarr: image: ghcr.io/hotio/sonarr:latest container_name: sonarr restart: unless-stopped environment: - PUID=${PUID} - PGID=${PGID} - TZ=${TZ} volumes: - ${DOCKER_DATA_DIR}/sonarr/config:/config - /mnt/tv:/tv - /mnt/downloads:/downloads ports: - "8989:8989" labels: - "traefik.enable=true" - "traefik.http.routers.sonarr.rule=Host(`${SONARR_HOSTNAME}`)" profiles: - sonarr ``` -------------------------------- ### Docker Service Health Checks and Dependencies Source: https://context7.com/viren070/docker-compose-template/llms.txt Illustrates how to configure health checks for Docker services, including examples for HTTP endpoints and database checks. It also shows how to define service dependencies using `depends_on` to ensure proper startup order and reliability. ```yaml # Health check example healthcheck: test: ["CMD-SHELL", "curl -s http://localhost:8989/ping | grep -q '"status": "OK"'"] interval: 1m timeout: 10s retries: 5 start_period: 10s # Dependency management depends_on: authelia: condition: service_healthy traefik: condition: service_healthy # Check service health docker compose ps # Shows status: healthy, unhealthy, or starting # View health check logs docker inspect --format='{{json .State.Health}}' container_name | jq # Restart unhealthy services docker compose restart service_name # Common health check patterns: # - HTTP endpoint: curl localhost:port/health # - Database: pg_isready, redis-cli ping # - API: curl + grep for expected response ``` -------------------------------- ### Clone Repository and Navigate Directory - Shell Source: https://github.com/viren070/docker-compose-template/blob/main/README.md This snippet demonstrates how to clone the Docker Compose VPS Template repository from GitHub and navigate into the newly created directory. It assumes the user is in the desired parent directory, typically '/opt'. ```shell cd /opt git clone https://github.com/Viren070/docker-compose-vps-template.git docker cd docker ``` -------------------------------- ### Environment Configuration (.env) for Docker Compose Source: https://context7.com/viren070/docker-compose-template/llms.txt Sets up essential environment variables for the Docker Compose deployment. This includes timezone, Docker directory, user/group IDs, compose profiles, domain name, Let's Encrypt email, and secrets for Authelia. It also includes an optional Cloudflare API token for DNS management. ```bash # Clone the repository cd /opt git clone https://github.com/Viren070/docker-compose-vps-template.git docker cd docker # Edit the .env file with required values nano .env # Required .env configuration: TZ=America/New_York DOCKER_DIR=/opt/docker PUID=1000 PGID=1000 COMPOSE_PROFILES="required" DOMAIN=example.com LETSENCRYPT_EMAIL=admin@example.com # Generate secrets for Authelia (minimum 64 characters each) AUTHELIA_SESSION_SECRET="$(openssl rand -base64 64 | tr -d '=/' | tr -d '\n')" AUTHELIA_STORAGE_ENCRYPTION_KEY="$(openssl rand -base64 64 | tr -d '=/' | tr -d '\n')" AUTHELIA_JWT_SECRET="$(openssl rand -base64 64 | tr -d '=/' | tr -d '\n')" # Optional: Cloudflare API token for automatic DNS management CLOUDFLARE_API_TOKEN=your_cloudflare_api_token_here ``` -------------------------------- ### View Logs for Specific Services with Docker Compose Profile - Shell Source: https://github.com/viren070/docker-compose-template/blob/main/README.md This command shows how to view the logs for services belonging to a specific profile, like 'seanime'. This is useful for debugging and monitoring individual application instances. ```shell docker compose --profile seanime logs ``` -------------------------------- ### Configure Radarr Instances with Docker Compose Source: https://context7.com/viren070/docker-compose-template/llms.txt Defines Docker Compose services for multiple Radarr instances (standard, 4K, anime), each with its own configuration directory and Traefik routing. It uses environment variables for PUID/PGID and hostnames, and includes a health check. ```yaml services: radarr: container_name: radarr image: ghcr.io/hotio/radarr:release restart: unless-stopped environment: - PUID=${PUID} - PGID=${PGID} volumes: - /mnt:/mnt:rslave - ${DOCKER_DATA_DIR}/radarr/default:/config labels: - "traefik.enable=true" - "traefik.http.routers.radarr.rule=Host(`${RADARR_HOSTNAME}`)" - "traefik.http.routers.radarr.middlewares=authelia@docker" - "traefik.http.services.radarr.loadbalancer.server.port=7878" healthcheck: test: ["CMD-SHELL", "curl -s http://localhost:7878/ping | grep -q '"status": "OK"'"] profiles: - radarr radarr4k: container_name: radarr4k image: ghcr.io/hotio/radarr:release volumes: - ${DOCKER_DATA_DIR}/radarr/4k:/config labels: - "traefik.http.routers.radarr4k.rule=Host(`${RADARR4K_HOSTNAME}`)" profiles: - radarr radarranime: container_name: radarranime image: ghcr.io/hotio/radarr:release volumes: - ${DOCKER_DATA_DIR}/radarr/anime:/config labels: - "traefik.http.routers.radarranime.rule=Host(`${RADARRANIME_HOSTNAME}`)" profiles: - radarr ``` -------------------------------- ### Configure Authelia Authentication Service with Docker Compose Source: https://context7.com/viren070/docker-compose-template/llms.txt This configuration sets up Authelia as a central authentication service. It leverages Docker Compose to define services for Authelia, Redis, and PostgreSQL. Environment variables are used for configuration, and Traefik is integrated for access control and routing. It supports SSO, 2FA, and WebAuthn. ```yaml services: authelia: container_name: authelia image: authelia/authelia restart: unless-stopped environment: X_AUTHELIA_CONFIG_FILTERS: template TEMPLATE_AUTHELIA_SESSION_SECRET: ${AUTHELIA_SESSION_SECRET} TEMPLATE_DOMAIN: ${DOMAIN} TEMPLATE_AUTHELIA_JWT_SECRET: ${AUTHELIA_JWT_SECRET} labels: - "traefik.enable=true" - "traefik.http.routers.authelia.rule=Host(`${AUTHELIA_HOSTNAME}`)" - "traefik.http.middlewares.authelia.forwardAuth.address=http://authelia:9091/api/authz/forward-auth" - "traefik.http.middlewares.authelia.forwardAuth.trustForwardHeader=true" depends_on: - authelia_redis - authelia_postgres authelia_redis: image: redis:latest command: redis-server --appendonly yes --save 60 1 authelia_postgres: image: postgres:17-alpine environment: POSTGRES_USER: authelia POSTGRES_PASSWORD: authelia POSTGRES_DB: authelia # Access Authelia at: https://auth.example.com # Default credentials: user1 / password (CHANGE THIS!) # Configure users in: apps/authelia/config/users_database.yml # Supports 2FA via TOTP, WebAuthn, and Duo ``` -------------------------------- ### Deploy Plex Media Server with Docker Compose Source: https://context7.com/viren070/docker-compose-template/llms.txt This Docker Compose configuration deploys the Plex Media Server, enabling media streaming and library management. It maps ports, sets environment variables for user/group IDs and timezones, and mounts volumes for configuration and media storage. Traefik integration is included for access via a hostname. ```yaml services: plex: image: plexinc/pms-docker:latest container_name: plex restart: unless-stopped ports: - "32400:32400/tcp" environment: - PLEX_UID=${PUID} - PLEX_GID=${PGID} - PLEX_CLAIM=${PLEX_CLAIM} - TZ=${TZ} volumes: - /dev/shm:/dev/shm - ${DOCKER_DATA_DIR}/plex/transcodes:/transcode - /mnt:/mnt:rslave - ${DOCKER_DATA_DIR}/plex/config:/config labels: - "traefik.enable=true" - "traefik.http.routers.plex.rule=Host(`${PLEX_HOSTNAME}`)" - "traefik.http.services.plex.loadbalancer.server.port=32400" profiles: - plex # Setup instructions: # 1. Get Plex claim token from: https://www.plex.tv/claim/ # 2. Add PLEX_CLAIM=claim-xxxxxxxxxxxx to apps/plex/.env # 3. Start service: docker compose --profile plex up -d # 4. Access at: https://plex.example.com # 5. Complete Plex setup wizard # 6. Add media libraries pointing to /mnt/ ``` -------------------------------- ### Restart Specific Services with Docker Compose Profile - Shell Source: https://github.com/viren070/docker-compose-template/blob/main/README.md This command demonstrates how to restart services associated with a specific profile, such as 'stremio'. This allows for targeted management of services without affecting others. ```shell docker compose --profile stremio restart ``` -------------------------------- ### Configure Sonarr Instances with Docker Compose Source: https://context7.com/viren070/docker-compose-template/llms.txt Defines Docker Compose services for multiple Sonarr instances (standard, 4K, anime), each with its own configuration directory and Traefik routing. It utilizes environment variables for PUID/PGID and hostnames, and includes a health check. ```yaml services: sonarr: container_name: sonarr image: ghcr.io/hotio/sonarr:release restart: unless-stopped environment: - PUID=${PUID} - PGID=${PGID} volumes: - /mnt:/mnt:rslave - ${DOCKER_DATA_DIR}/sonarr/default:/config labels: - "traefik.enable=true" - "traefik.http.routers.sonarr.rule=Host(`${SONARR_HOSTNAME}`)" - "traefik.http.routers.sonarr.middlewares=authelia@docker" - "traefik.http.services.sonarr.loadbalancer.server.port=8989" healthcheck: test: ["CMD-SHELL", "curl -s http://localhost:8989/ping | grep -q '"status": "OK"'"] profiles: - sonarr sonarr4k: container_name: sonarr4k image: ghcr.io/hotio/sonarr:release volumes: - ${DOCKER_DATA_DIR}/sonarr/4k:/config labels: - "traefik.http.routers.sonarr4k.rule=Host(`${SONARR4K_HOSTNAME}`)" profiles: - sonarr sonarranime: container_name: sonarranime image: ghcr.io/hotio/sonarr:release volumes: - ${DOCKER_DATA_DIR}/sonarr/anime:/config labels: - "traefik.http.routers.sonarranime.rule=Host(`${SONARRANIME_HOSTNAME}`)" profiles: - sonarr ``` -------------------------------- ### Set up Overseerr Request Management with Docker Compose Source: https://context7.com/viren070/docker-compose-template/llms.txt This configuration deploys Overseerr, a service for managing media requests. It runs as a Docker container, maps a volume for configuration, and sets environment variables for logging level and timezone. Traefik is configured to route requests to the Overseerr service based on a hostname. It integrates with Plex for authentication and Sonarr/Radarr for managing requests. ```yaml services: overseerr: image: sctx/overseerr:latest container_name: overseerr restart: unless-stopped environment: - LOG_LEVEL=debug - TZ=${TZ} - PORT=5055 volumes: - ${DOCKER_DATA_DIR}/overseerr:/app/config labels: - "traefik.enable=true" - "traefik.http.routers.overseerr.rule=Host(`${OVERSEERR_HOSTNAME}`)" profiles: - overseerr # Configuration: # 1. Deploy with: docker compose --profile overseerr up -d # 2. Access at: https://overseerr.example.com # 3. Sign in with Plex account # 4. Configure Radarr connection: # - Server: http://radarr:7878 # - API Key: (from Radarr settings) # 5. Configure Sonarr connection: # - Server: http://sonarr:8989 # - API Key: (from Sonarr settings) ``` -------------------------------- ### Traefik Reverse Proxy Configuration Source: https://context7.com/viren070/docker-compose-template/llms.txt Configuration for the Traefik reverse proxy service, defining its image, ports, command-line arguments for enabling API, Docker provider, and HTTP to HTTPS redirection. It also specifies volumes for Docker socket and data, and labels for Traefik routing and middleware. ```yaml # From apps/traefik/compose.yaml services: traefik: image: traefik:v3 container_name: traefik restart: unless-stopped ports: - 443:443 - 80:80 command: - "--api.dashboard=true" - "--providers.docker=true" - "--providers.docker.exposedbydefault=false" - "--entryPoints.web.address=:80" - "--entryPoints.websecure.address=:443" - "--entryPoints.web.http.redirections.entryPoint.to=websecure" - "--certificatesresolvers.letsencrypt.acme.tlschallenge=true" - "--certificatesresolvers.letsencrypt.acme.email=${LETSENCRYPT_EMAIL}" volumes: - "/var/run/docker.sock:/var/run/docker.sock" - "${DOCKER_DATA_DIR}/traefik:/data" labels: - "traefik.enable=true" - "traefik.http.routers.api.rule=Host(`${TRAEFIK_HOSTNAME}`)" - "traefik.http.routers.api.middlewares=authelia@docker" profiles: - required # Access Traefik dashboard at: https://traefik.example.com # Automatically obtains Let's Encrypt SSL certificates # HTTP (port 80) automatically redirects to HTTPS (port 443) ``` -------------------------------- ### Integrate Cloudflare DDNS with Docker Compose Source: https://context7.com/viren070/docker-compose-template/llms.txt This configuration sets up Cloudflare DDNS to automatically manage DNS records for your services. It uses the 'favonia/cloudflare-ddns' image and requires Cloudflare API token and domain information via environment variables. The 'host' network mode is used for direct access. It's designed to update A/AAAA records based on IP changes. ```yaml services: cloudflare-ddns: image: favonia/cloudflare-ddns:1 container_name: cloudflare-ddns restart: unless-stopped network_mode: host environment: CLOUDFLARE_API_TOKEN: "${CLOUDFLARE_API_TOKEN}" PROXIED: false DOMAINS: > ${PLEX_HOSTNAME}, ${OVERSEERR_HOSTNAME}, ${SONARR_HOSTNAME}, ${RADARR_HOSTNAME}, ${TRAEFIK_HOSTNAME} profiles: - cloudflare-ddns # Enable Cloudflare DDNS: # 1. Add domain to Cloudflare # 2. Update nameservers to Cloudflare # 3. Create API token at: https://dash.cloudflare.com/profile/api-tokens # Use "Edit zone DNS" template # 4. Set CLOUDFLARE_API_TOKEN in .env # 5. Add 'cloudflare-ddns' to COMPOSE_PROFILES # # Automatically creates A/AAAA records for all hostnames # Updates records if IP address changes ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.