fix self-host documents script generated docker-compose.yaml file content.
Official Instance
- [ ] The bug is reproducible on the official hosted instance, or is API-related.
Describe the bug
After running configure-instance.sh, the docker-compose file generated via traefik labels has some problems:
- The nginx container label for traefik "traefik.http.services.piped.loadbalancer.server.port=8080" uses wrong port. it should be 80.
- 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.
- 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
-
First, install git, docker, and the compose plugin for docker.
-
Run git clone https://github.com/TeamPiped/Piped-Docker.
-
Then, run cd Piped-Docker.
-
Then, run ./configure-instance.sh and fill in the hostnames when asked. Choose nginx as the reverse proxy when asked.
-
Now, create A (and AAAA) records to your server’s public IP with the hostnames you had filled in above.
-
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
- Run docker compose up -d.
- 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
Sounds reasonable, please create a pull request here at this repository!