Giter Site home page Giter Site logo

Comments (22)

 avatar commented on August 10, 2024 1

Thanks!

from dockerswarm.rocks.

 avatar commented on August 10, 2024 1

Oh ok good to know. Maybe I test some other services for the swarm tutorials.

from dockerswarm.rocks.

 avatar commented on August 10, 2024 1

Thanks for aksing me, yes we can close it.

from dockerswarm.rocks.

 avatar commented on August 10, 2024

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!

from dockerswarm.rocks.

rayrrr avatar rayrrr commented on August 10, 2024

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!

from dockerswarm.rocks.

 avatar commented on August 10, 2024

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:

from dockerswarm.rocks.

rayrrr avatar rayrrr commented on August 10, 2024

No that is not what I meant.

from dockerswarm.rocks.

tiangolo avatar tiangolo commented on August 10, 2024

@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:

from dockerswarm.rocks.

 avatar commented on August 10, 2024

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?

from dockerswarm.rocks.

tiangolo avatar tiangolo commented on August 10, 2024

See my response here: #4 (comment)

from dockerswarm.rocks.

 avatar commented on August 10, 2024

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.

from dockerswarm.rocks.

tiangolo avatar tiangolo commented on August 10, 2024

@noobcoder1983 I think I have a gift for you 🎁

https://dockerswarm.rocks/thelounge/

from dockerswarm.rocks.

 avatar commented on August 10, 2024

@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)?

from dockerswarm.rocks.

tiangolo avatar tiangolo commented on August 10, 2024

Yep, the process would be similar for Gitea.

from dockerswarm.rocks.

 avatar commented on August 10, 2024

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

from dockerswarm.rocks.

 avatar commented on August 10, 2024

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.

from dockerswarm.rocks.

tiangolo avatar tiangolo commented on August 10, 2024

Great! I'll add Gitea later (unless a PR comes first 😁 ).

from dockerswarm.rocks.

 avatar commented on August 10, 2024

Ok cool thanks. Hmm PR?

from dockerswarm.rocks.

tiangolo avatar tiangolo commented on August 10, 2024

A Pull Request: https://help.github.com/en/articles/creating-a-pull-request

from dockerswarm.rocks.

 avatar commented on August 10, 2024

Excuse my unknowing 😱

I hope in the future I will learn more and more about github. πŸ˜„

So with a pull request I could add my knowledge to your repo?

from dockerswarm.rocks.

tiangolo avatar tiangolo commented on August 10, 2024

No worries!

Yep, with a pull request you could add it.

from dockerswarm.rocks.

tiangolo avatar tiangolo commented on August 10, 2024

I think we can close this issue now, right @noobcoder1983 ?

from dockerswarm.rocks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.