Closed ghost closed 4 years ago
I also tried this but also this results in a 404 error:
version: '3.3'
services:
thelounge:
image: thelounge/thelounge:latest
volumes:
- thelounge-data:/data
#- ~/data/thelounge:/var/opt/thelounge
networks:
- traefik-public
deploy:
placement:
constraints:
- node.role == manager
- node.labels.thelounge.thelounge-data == true
labels:
# - traefik.backend=thelounge
- traefik.enable=true
- traefik.frontend.rule=Host:${DOMAIN}
- traefik.port=4000
- traefik.docker.network=traefik-public
- traefik.tags=traefik-public
# Traefik service that listens to HTTP
- traefik.redirectorservice.frontend.entryPoints=http
- traefik.redirectorservice.frontend.redirect.entryPoint=https
# Traefik service that listens to HTTPS
- traefik.webservice.frontend.entryPoints=https
networks:
#- web
- traefik-public
networks:
traefik-public:
external: true
volumes:
thelounge-data:
any ideas what I have done wrong?
Thanks!
Try indenting your whole labels
block so that it is under a deploy
block (with the deploy block at the same indentation level as in your last example). That got it working for me!
Thanks you mean like:
version: '3.3'
services:
thelounge:
image: thelounge/thelounge:latest
volumes:
- thelounge-data:/data
#- ~/data/thelounge:/var/opt/thelounge
networks:
- traefik-public
labels:
# - traefik.backend=thelounge
- traefik.enable=true
- traefik.frontend.rule=Host:${DOMAIN}
- traefik.port=4000
- traefik.docker.network=traefik-public
- traefik.tags=traefik-public
# Traefik service that listens to HTTP
- traefik.redirectorservice.frontend.entryPoints=http
- traefik.redirectorservice.frontend.redirect.entryPoint=https
# Traefik service that listens to HTTPS
- traefik.webservice.frontend.entryPoints=https
networks:
#- web
- traefik-public
deploy:
placement:
constraints:
- node.role == manager
- node.labels.thelounge.thelounge-data == true
networks:
traefik-public:
external: true
volumes:
thelounge-data:
No that is not what I meant.
@noobcoder1983 what @rayrrr is saying is that you should put the labels inside the deploy
key, something like:
version: '3.3'
services:
thelounge:
image: thelounge/thelounge:latest
volumes:
- thelounge-data:/data
#- ~/data/thelounge:/var/opt/thelounge
networks:
- traefik-public
networks:
#- web
- traefik-public
deploy:
labels:
# - traefik.backend=thelounge
- traefik.enable=true
- traefik.frontend.rule=Host:${DOMAIN}
- traefik.port=4000
- traefik.docker.network=traefik-public
- traefik.tags=traefik-public
# Traefik service that listens to HTTP
- traefik.redirectorservice.frontend.entryPoints=http
- traefik.redirectorservice.frontend.redirect.entryPoint=https
# Traefik service that listens to HTTPS
- traefik.webservice.frontend.entryPoints=https
placement:
constraints:
- node.role == manager
- node.labels.thelounge.thelounge-data == true
networks:
traefik-public:
external: true
volumes:
thelounge-data:
Also, as your app seems to be running on port 9000
you probably should declare it as such:
version: '3.3'
services:
thelounge:
image: thelounge/thelounge:latest
volumes:
- thelounge-data:/data
#- ~/data/thelounge:/var/opt/thelounge
networks:
- traefik-public
networks:
#- web
- traefik-public
deploy:
labels:
# - traefik.backend=thelounge
- traefik.enable=true
- traefik.frontend.rule=Host:${DOMAIN}
- traefik.port=9000
- traefik.docker.network=traefik-public
- traefik.tags=traefik-public
# Traefik service that listens to HTTP
- traefik.redirectorservice.frontend.entryPoints=http
- traefik.redirectorservice.frontend.redirect.entryPoint=https
# Traefik service that listens to HTTPS
- traefik.webservice.frontend.entryPoints=https
placement:
constraints:
- node.role == manager
- node.labels.thelounge.thelounge-data == true
networks:
traefik-public:
external: true
volumes:
thelounge-data:
Ok thank you very much for your hints. I will try that :-) When the lounge uses that port and another container is using that port too. What could be the best way to edit thelounge port in the config.js?
See my response here: https://github.com/tiangolo/dockerswarm.rocks/issues/4#issuecomment-491513714
Thanks!
Nope that does not help. I tried this:
export NODE_ID=$(docker info -f '{{.Swarm.NodeID}}')
docker node update --label-add thelounge.thelounge-data=true $NODE_ID
with the new .yml file you posted above. Error 404 appears again. :-(
I'm desperate and I really don't know what to do.
@noobcoder1983 I think I have a gift for you :gift:
@tiangolo Thank you so much for your efforts and for the gift. So I was probably close when I compare the compose files. Well, just next to it is also over.
Oh, and it works fine. Hm if I can make it to get run Gitea (https://hub.docker.com/r/gitea/gitea)?
Yep, the process would be similar for Gitea.
Hmm I tried that:
version: '3.3'
services:
app:
image: gitea/gitea:latest
volumes:
- gitea-data:/data
networks:
- traefik-public
deploy:
placement:
constraints:
- node.labels.gitea.gitea-data == true
labels:
- traefik.frontend.rule=Host:${DOMAIN}
- traefik.enable=true
- traefik.port=9000
- traefik.tags=traefik-public
- traefik.docker.network=traefik-public
# Traefik service that listens to HTTP
- traefik.redirectorservice.frontend.entryPoints=http
- traefik.redirectorservice.frontend.redirect.entryPoint=https
# Traefik service that listens to HTTPS
- traefik.webservice.frontend.entryPoints=https
#enviroment:
- USER_UID=1000
- USER_GID=1000
#ports:
- "2221:22"
networks:
traefik-public:
external: true
volumes:
gitea-data:
But I am always getting the error:
Bad gateway
from traefik
Oh had the wrong port with 3000 it works, my failure.
And here the correct gitea.yml file:
version: '3.3'
services:
app:
image: gitea/gitea:latest
volumes:
- gitea-data:/data
networks:
- traefik-public
deploy:
placement:
constraints:
- node.labels.gitea.gitea-data == true
labels:
- traefik.frontend.rule=Host:${DOMAIN}
- traefik.enable=true
- traefik.port=3000
- traefik.tags=traefik-public
- traefik.docker.network=traefik-public
# Traefik service that listens to HTTP
- traefik.redirectorservice.frontend.entryPoints=http
- traefik.redirectorservice.frontend.redirect.entryPoint=https
# Traefik service that listens to HTTPS
- traefik.webservice.frontend.entryPoints=https
#enviroment:
- USER_UID=1000
- USER_GID=1000
#ports:
- "2221:22"
networks:
traefik-public:
external: true
volumes:
gitea-data:
Maybe you want to add it to your website. After deploying go to gitea instance and click on register to activate admin account for further usage.
Great! I'll add Gitea later (unless a PR comes first :grin: ).
Ok cool thanks. Hmm PR?
A Pull Request: https://help.github.com/en/articles/creating-a-pull-request
Excuse my unknowing :scream:
I hope in the future I will learn more and more about github. :smile:
So with a pull request I could add my knowledge to your repo?
No worries!
Yep, with a pull request you could add it.
Oh ok good to know. Maybe I test some other services for the swarm tutorials.
I think we can close this issue now, right @noobcoder1983 ?
Thanks for aksing me, yes we can close it.
Hello, Sebastián,
we e-mailed a few days ago. Unfortunately I didn't get any further to start thelounge (https://hub.docker.com/r/thelounge/thelounge/), but like colleagues here I get the 404 error from traefik.
My thelounge.yml file looks like this:
What did I do wrong? Can anyone please help me with my problem?
Edit: I also tried:
Also the 404 error appears. :-(