我启动2个容器时找不到erreur 404 Traefik

时间:2019-12-27 13:14:06

标签: docker-compose

同时启动两个容器时出现404错误。例如,当我单独启动Nextcloud时,我会得到一个“让我们加密”证书,并且服务会响应。但是,例如,如果我启动Sonarr容器,则在这种情况下,Nextcloud通过Traefik返回404 not found错误。声纳也一样。好像发生了特拉菲克冲突。 这是我的docker-composes.yml:

version: '3.3'
services:
  traefik:
    image: "traefik:latest"
    container_name: "traefik"
    command:
      - "--log.level=DEBUG"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:443"
      - "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true"
      - "--certificatesresolvers.myhttpchallenge.acme.httpchallenge.entrypoint=web"
      - "--certificatesresolvers.mytlschallenge.acme.email=mail@mail.com"
      - "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json"
    ports:
      - "8080:8080"
      - "443:443"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "./letsencrypt:/letsencrypt"
      - "./rules:/rules:ro"
    networks:
      - internal_network
      - external_network
  teamspeak:
    container_name: teamspeak
    image: teamspeak
    restart: always
    ports:
      - 9987:9987/udp
      - 10011:10011
      - 30033:30033
    environment:
      TS3SERVER_LICENSE: accept
    networks:
      - external_network
  db:
    container_name: PostgreSQL
    image: postgres:alpine
    restart: always
    volumes:
      - ./postgres:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=passwd
      - POSTGRES_USER=user
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "postgres"]
    networks:
      - internal_network
  nextcloud:
    container_name: Nextcloud
    image: nextcloud
    restart: always
    volumes:
      - $PWD/nextcloud/config:/var/www/html/config
      - $PWD/nextcloud/cloud:/var/www/html
      - $PWD/nextcloud/data:/var/www/html/data
      - $PWD/nextcloud/apps:/var/www/html/apps
    environment:
      - POSTGRES_HOST=db
      - POSTGRES_DB=nextcloud
    labels:
      - "traefik.enable=true"
      - "traefik.port=80"
      - "traefik.http.routers.cloud.entrypoints=web"
      - "traefik.http.routers.cloud.rule=Host(`nextcloud.domain.tld`)"
      - "traefik.http.routers.cloud.tls.certresolver=mytlschallenge"
      - "traefik.http.routers.cloud.middlewares=cloud@docker"
      - "traefik.docker.network=external_network"
      - "traefik.http.middlewares.cloud.headers.customFrameOptionsValue=SAMEORIGIN"
      - "traefik.http.middlewares.cloud.headers.framedeny=true"
      - "traefik.http.middlewares.cloud.headers.sslredirect=true"
      - "traefik.http.middlewares.cloud.headers.stsIncludeSubdomains=true"
      - "traefik.http.middlewares.cloud.headers.stsPreload=true"
      - "traefik.http.middlewares.cloud.headers.stsSeconds=15552000"
    links:
      - db
    networks:
      - external_network
      - internal_network

  torrent:
    container_name: qbittorent-vpn
    image: markusmcnugen/qbittorrentvpn
    ports:
      - 6969:6969
      - 6969:6969/udp
    sysctls:
      net.ipv6.conf.all.disable_ipv6: 0
    privileged: true
    environment:
      - VPN_ENABLED=yes
      - VPN_USERNAME=user
      - VPN-PASSWORD=passwd
      - LAN_NETWORK=192.168.1.0/24
    volumes:
      - ./torrent:/config
      - ./media:/downloads
    privileged: true
    labels:
      - "traefik.enable=true"
      - "traefik.port=80"
      - "traefik.http.routers.cloud.entrypoints=web"
      - "traefik.http.routers.cloud.rule=Host(`torrent.domain.tld`)"
      - "traefik.http.routers.cloud.tls.certresolver=mytlschallenge"
      - "traefik.http.routers.cloud.middlewares=cloud@docker"
      - "traefik.docker.network=external_network"
      - "traefik.http.middlewares.cloud.headers.customFrameOptionsValue=SAMEORIGIN"
      - "traefik.http.middlewares.cloud.headers.framedeny=true"
      - "traefik.http.middlewares.cloud.headers.sslredirect=true"
      - "traefik.http.middlewares.cloud.headers.stsIncludeSubdomains=true"
      - "traefik.http.middlewares.cloud.headers.stsPreload=true"
      - "traefik.http.middlewares.cloud.headers.stsSeconds=15552000"

  sonarr:
    container_name: Sonarr
    image: linuxserver/sonarr:preview
    ports:
      - 8989:8989
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Paris
    volumes:
      - ./sonarr:/config
      - ./media/TV:/tv
    labels:
      - "traefik.enable=true"
      - "traefik.port=80"
      - "traefik.http.routers.cloud.entrypoints=web"
      - "traefik.http.routers.cloud.rule=Host(`sonarr.domain.tld`)"
      - "traefik.http.routers.cloud.tls.certresolver=mytlschallenge"
      - "traefik.http.routers.cloud.middlewares=cloud@docker"
      - "traefik.docker.network=external_network"
      - "traefik.http.middlewares.cloud.headers.customFrameOptionsValue=SAMEORIGIN"
      - "traefik.http.middlewares.cloud.headers.framedeny=true"
      - "traefik.http.middlewares.cloud.headers.sslredirect=true"
      - "traefik.http.middlewares.cloud.headers.stsIncludeSubdomains=true"
      - "traefik.http.middlewares.cloud.headers.stsPreload=true"
      - "traefik.http.middlewares.cloud.headers.stsSeconds=15552000"
    networks:
      - internal_network
      - external_network
  jackett:
    container_name: Jackett
    image: linuxserver/jackett
    ports:
      - 9117:9117
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Paris
    volumes:
      - ./jackett:/config
    labels:
      - "traefik.enable=true"
      - "traefik.port=80"
      - "traefik.http.routers.cloud.entrypoints=web"
      - "traefik.http.routers.cloud.rule=Host(`jackett.domain.tld`)"
      - "traefik.http.routers.cloud.tls.certresolver=mytlschallenge"
      - "traefik.http.routers.cloud.middlewares=cloud@docker"
      - "traefik.docker.network=external_network"
      - "traefik.http.middlewares.cloud.headers.customFrameOptionsValue=SAMEORIGIN"
      - "traefik.http.middlewares.cloud.headers.framedeny=true"
      - "traefik.http.middlewares.cloud.headers.sslredirect=true"
      - "traefik.http.middlewares.cloud.headers.stsIncludeSubdomains=true"
      - "traefik.http.middlewares.cloud.headers.stsPreload=true"
      - "traefik.http.middlewares.cloud.headers.stsSeconds=15552000"
    networks:
      - internal_network
      - external_network
  jellyfin:
    container_name: Jellyfin
    image: jellyfin/jellyfin
    environment:
      TZ: Europe/Paris
    volumes:  
      - $PWD/jellyfin/config:/config  
      - $PWD/jellyfin/cache:/cache  
      - $PWD/jellyfin/media:/media
      - $PWD/media/movies:/media/movies
      - $PWD/media/series:/media/series
    ports:
      - 8096:8096
      - 8920:8920
    labels:
      - "traefik.enable=true"
      - "traefik.port=80"
      - "traefik.http.routers.cloud.entrypoints=web"
      - "traefik.http.routers.cloud.rule=Host(`jellyfin.domain.tld`)"
      - "traefik.http.routers.cloud.tls.certresolver=mytlschallenge"
      - "traefik.http.routers.cloud.middlewares=cloud@docker"
      - "traefik.docker.network=external_network"
      - "traefik.http.middlewares.cloud.headers.customFrameOptionsValue=SAMEORIGIN"
      - "traefik.http.middlewares.cloud.headers.framedeny=true"
      - "traefik.http.middlewares.cloud.headers.sslredirect=true"
      - "traefik.http.middlewares.cloud.headers.stsIncludeSubdomains=true"
      - "traefik.http.middlewares.cloud.headers.stsPreload=true"
      - "traefik.http.middlewares.cloud.headers.stsSeconds=15552000"
    networks:
      - internal_network
      - external_network
networks:
  external_network:
    external:
      name: external_network
  internal_network:
    driver: bridge

此外,如果您在我的docker-composer文件中发现错误,则说明我处于打开状态,我正在学习...

0 个答案:

没有答案