Piped-Docker icon indicating copy to clipboard operation
Piped-Docker copied to clipboard

fix self-host documents script generated docker-compose.yaml file content.

Open fs8vsx59h opened this issue 2 years ago • 1 comments

Official Instance

Describe the bug

After running configure-instance.sh, the docker-compose file generated via traefik labels has some problems:

  1. The nginx container label for traefik "traefik.http.services.piped.loadbalancer.server.port=8080" uses wrong port. it should be 80.
  2. should clearly explain in documents, if user want to use an existing reverse proxy, the current compose file is correct, the user can just edit his configuration, reverse the localhost:8080. but traefik label only work when in the same docker network with nginx, and if user want to append a traefik container at the end of the compose file, the nginx container should not map ports.
  3. current:
    nginx:
        image: nginx:mainline-alpine
        restart: unless-stopped
        ports:
            - "8080:80"
        volumes:
            - ./config/nginx.conf:/etc/nginx/nginx.conf:ro
            - ./config/pipedapi.conf:/etc/nginx/conf.d/pipedapi.conf:ro
            - ./config/pipedproxy.conf:/etc/nginx/conf.d/pipedproxy.conf:ro
            - ./config/pipedfrontend.conf:/etc/nginx/conf.d/pipedfrontend.conf:ro
            - ./config/ytproxy.conf:/etc/nginx/snippets/ytproxy.conf:ro
            - piped-proxy:/var/run/ytproxy
        container_name: nginx
        depends_on:
            - piped
            - piped-proxy
            - pipedfrontend
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.piped.rule=Host(``)"
            - "traefik.http.routers.piped.entrypoints="
            - "traefik.http.services.piped.loadbalancer.server.port=8080"

changed:

    nginx:
        image: nginx:mainline-alpine
        restart: unless-stopped
        # ports:
        #     - "8080:80"
        volumes:
            - ./config/nginx.conf:/etc/nginx/nginx.conf:ro
            - ./config/pipedapi.conf:/etc/nginx/conf.d/pipedapi.conf:ro
            - ./config/pipedproxy.conf:/etc/nginx/conf.d/pipedproxy.conf:ro
            - ./config/pipedfrontend.conf:/etc/nginx/conf.d/pipedfrontend.conf:ro
            - ./config/ytproxy.conf:/etc/nginx/snippets/ytproxy.conf:ro
            - piped-proxy:/var/run/ytproxy
        container_name: nginx
        depends_on:
            - piped
            - piped-proxy
            - pipedfrontend
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.piped.rule=Host(``)"
            - "traefik.http.routers.piped.entrypoints="
            - "traefik.http.services.piped.loadbalancer.server.port=80"
            - "traefik.http.routers.piped.tls.certresolver="

To Reproduce

  1. First, install git, docker, and the compose plugin for docker.

  2. Run git clone https://github.com/TeamPiped/Piped-Docker.

  3. Then, run cd Piped-Docker.

  4. Then, run ./configure-instance.sh and fill in the hostnames when asked. Choose nginx as the reverse proxy when asked.

  5. Now, create A (and AAAA) records to your server’s public IP with the hostnames you had filled in above.

  6. Append a traefik container at last of compose file like this one:

    traefik:
        image: traefik:latest
        ports:
            - "80:80"
            - "443:443"
        volumes:
        - ./traefik/:/etc/traefik/
        - /var/run/docker.sock:/var/run/docker.sock:ro
  1. Run docker compose up -d.
  2. And the traefik logs start appear ‘502 bad gatewat' , nginx:8080 refuse connect. because traefik labels use wrong port.

Expected behavior

the traefik should connect nginx correctly , and start reverse proxy traffic

Logs/Errors

piped-docker-traefik-1  | time="2023-12-09T09:35:51Z" level=debug msg="'502 Bad Gateway' caused by: dial tcp 172.20.0.8:8080: connect: connection refused"
piped-docker-traefik-1  | time="2023-12-09T09:35:52Z" level=debug msg="'502 Bad Gateway' caused by: dial tcp 172.20.0.8:8080: connect: connection refused"
piped-docker-traefik-1  | time="2023-12-09T09:38:03Z" level=debug msg="'502 Bad Gateway' caused by: dial tcp 172.20.0.8:8080: connect: connection refused"
piped-docker-traefik-1  | time="2023-12-09T09:38:04Z" level=debug msg="'502 Bad Gateway' caused by: dial tcp 172.20.0.8:8080: connect: connection refused"

Browser, and OS with Version.

chrome:latest windows10 workstation:latest docker-ce:latest

Additional context

No response

fs8vsx59h avatar Dec 09 '23 10:12 fs8vsx59h

Sounds reasonable, please create a pull request here at this repository!

Bnyro avatar May 23 '24 15:05 Bnyro