Jump to content
ChopFitzroy

Setting up traefik reverse proxy in docker container with static IP

1 post in this topic Last Reply

Recommended Posts

Posted (edited)

I am super new to Unraid and servers in general, I am trying to setup a traefik reverse proxy in docker.

I am following the instructions from this repo https://github.com/duhio/docker-compose-usenet but I don't want to have to move the Unraid webui to a custom port, instead I would like to setup the traefik docker container to have it's own IP and the port forward to the docker container IP on 80 and 443, then I can just access the unraid webui when I VPN onto my home network.

I have modified the docker-compose.yml to suit my needs and added a networks block like so:

---
version: '3'

services:

  traefik:
    image: traefik:latest
    command: --web --docker --docker.watch --docker.domain=${DOMAIN} \
             --docker.exposedbydefault=false --acme.domains=${DOMAIN}
    container_name: traefik
    hostname: traefik
    #ports:
      #- "80:80"
      #- "443:443"
    networks:
      local:
        ipv4_address: 10.0.0.1
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ${CONFIG}/traefik/acme.json:/acme.json
      - ${CONFIG}/traefik/traefik.toml:/etc/traefik/traefik.toml
      - ${CONFIG}/traefik/.htpasswd:/etc/traefik/.htpasswd:ro
    labels:
      traefik.enable: "true"
      traefik.frontend.rule: "Host:monitor.${DOMAIN}"
      traefik.port: "8080"
      traefik.frontend.auth.basic: "${HTPASSWD}"
      com.ouroboros.enable: "true"
    restart: unless-stopped

  ouroboros:
    image: pyouroboros/ouroboros
    container_name: ouroboros
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - PGID
      - PUID
      - TZ
      - CLEANUP=true
      - INTERVAL=86400  # 24hrs
      - SELF_UPDATE=true
      - LABELS_ONLY=true
    restart: unless-stopped

  plex:
    image: linuxserver/plex
    container_name: plex
    hostname: plex
    ports:
      - "32400:32400"
      - "32400:32400/udp"
      - "32469:32469"
      - "32469:32469/udp"
      - "1900:1900/udp"
    volumes:
      - ${CONFIG}/plex:/config
      - ${DATA}/TV:/media/tv
      - ${DATA}/movies:/media/movies
      - ${DATA}/music:/media/music
      - ${DATA}/anime:/media/anime
    environment:
      - PGID
      - PUID
      - TZ
      - VERSION=latest
    labels:
      traefik.enable: "true"
      traefik.port: "32400"
      traefik.frontend.rule: "Host:plex.${DOMAIN}"
      com.ouroboros.enable: "true"
    restart: unless-stopped

  plexpy:
    image: linuxserver/tautulli:latest
    container_name: tautulli
    hostname: tautulli
    ports:
      - "8181:8181"
    volumes:
      - ${CONFIG}/plexpy:/config
      - ${CONFIG}/plex/Library/Application Support/Plex Media Server/Logs:/logs:ro
    environment:
      - PGID
      - PUID
      - TZ
    labels:
      traefik.enable: "true"
      traefik.port: "8181"
      traefik.frontend.rule: "Host:tautulli.${DOMAIN}"
      traefik.frontend.auth.basic: "${HTPASSWD}"
      com.ouroboros.enable: "true"
    restart: unless-stopped

  heimdall:
    image: duhio/heimdall-https:latest
    container_name: heimdall
    hostname: heimdall
    volumes:
      - ${CONFIG}/heimdall:/config
    environment:
      - PGID
      - PUID
      - TZ
    labels:
      traefik.enable: "true"
      traefik.port: "80"
      traefik.frontend.rule: "Host:${DOMAIN}"
      traefik.frontend.auth.basic: "${HTPASSWD}"
      com.ouroboros.enable: "true"
    restart: unless-stopped

  ombi:
    image: linuxserver/ombi
    container_name: ombi
    hostname: ombi
    ports:
      - "3579:3579"
    volumes:
      - ${CONFIG}/ombi:/config
    environment:
      - PGID
      - PUID
      - TZ
    labels:
      traefik.enable: "true"
      traefik.port: "3579"
      traefik.frontend.rule: "Host:ombi.${DOMAIN}"
      com.ouroboros.enable: "true"
    restart: unless-stopped

networks:
  local:
    ipam:
      driver: default
      config:
        - subnet: 10.0.0.0/24

However now when I run docker-compose up -d I get the following error:

tautulli is up-to-date
Starting traefik ...
plex is up-to-date
ombi is up-to-date
ouroboros is up-to-date
Starting traefik ... error

ERROR: for traefik  Cannot start service traefik: Address already in use

ERROR: for traefik  Cannot start service traefik: Address already in use
ERROR: Encountered errors while bringing up the project.

If anyone has any docker experience or traefik and knows the cause of the issue any help would be greatly appreciated.

 

UPDATE:

After a bit more digging I have figured out what I need to do I am just having trouble getting it to work with docker-compose, basically I want to assign a static IP on the bridge Unraid provisions automatically for docker containers (br0).

Essentially what I want to do is what I am doing in the below screenshot but via the docker-compose.yml

 

2019-05-20_08-00.thumb.png.3f60d2dd8503889b5ee8bb111e729b26.png

Edited by ChopFitzroy
Updates

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.