Share a traefik with another service

Infos:

  • Used Zammad version: 6.5.2
  • Used Zammad installation type: docker-compose
  • Operating system: Ubuntu
  • Browser + version: All

Expected behavior: Access Zammad with https by traefik

Actual behavior: Access Zammad only by http on 8080 port

Steps to reproduce the behavior:

On a VM, I have a Docker that has many services, including:

  • A global traefik named “traefik-net” in a dedicated Docker-compose
  • A web service open on “127.0.0.1:5678->5678/tcp” via “ports…” that relies on traefik via the labels + network declaration in another Docker-compose. Therefore, it is accessible via a dedicated domain name.
  • Zammad services: I would like it to be accessible on another domain (which also seems to be well declared in the traefik)

Questions:

  • Should I declare it on the zammad-nginx service or on the zammad-service? (I tried both without success).
  • Should I create a load balancer on the 8080?
  • Is there another way to have multiple services on ports 80/443 targeted based on the URL domain?

My statement:
labels:

  • traefik.enable=true
  • traefik.http.routers.zammad.rule=Host(ticketing.uby-monitoring.com)
  • traefik.http.routers.zammad.entrypoints=web,websecure
  • traefik.http.routers.zammad.tls=true
  • traefik.http.routers.zammad.tls.certresolver=mytlschallenge

- traefik.http.services.zammad.loadbalancer.server.port=8080

networks: - traefik-net # set on each zammad service

I am not familiar with traefik, so I cannot help you there, but it is the zammad-nginx-container, you will need to forward your requests to. If you want to add the container to your traefik-net you can use the following scenario without the need to modify the docker-compose.yml.

So if I understand you correctly… you can use labels to specify another domain in docker-compose.override.yml.

labels:
#      traefik.http.routers.zammad-secure.rule: Host(`${ZAMMAD_DOMAIN}`)
      traefik.http.routers.zammad-secure.rule: Host(`ticket.example.com`) || Host(`test2.example.com`)

so if u use the docker-compose.yml via git a full docker-compose.override.yml (see Install with Docker — Zammad System Documentation documentation) could look like this:

---
x-shared:
  zammad-service: &zammad-service
    volumes:
    ## Custom Mail-Templates
      - ./data/mailer/ticket_craete/de.html.erb.custom:/opt/zammad/app/views/mailer/ticket_create/de.html.erb.custom
      - ./data/mailer/ticket_update/de.html.erb.custom:/opt/zammad/app/views/mailer/ticket_update/de.html.erb.custom

services:
  zammad-backup:
    <<: *zammad-service

  zammad-init:
    <<: *zammad-service

  zammad-nginx:
    <<: *zammad-service
    environment:
      - RAILS_TRUSTED_PROXIES=['127.0.0.1', '::1', '0.0.0.0', '::0', '172.31.128.2/18']
#      - VIRTUAL_HOST=${ZAMMAD_DOMAIN}
      - VIRTUAL_HOST=ticket.example.com
      - NGINX_SERVER_SCHEME=https
      - NGINX_PORT=8081
      - NGINX_EXPOSE_PORT=8081

    labels:
      traefik.docker.network: proxy
      traefik.enable: "true"
      traefik.http.routers.zammad-secure.entrypoints: websecure
      traefik.http.routers.zammad-secure.middlewares: default@file
#      traefik.http.routers.zammad-secure.rule: Host(`${ZAMMAD_DOMAIN}`)
      traefik.http.routers.zammad-secure.rule: Host(`ticket.example.com`) || Host(`test2.example.com`)
      traefik.http.routers.zammad-secure.service: zammad
      traefik.http.routers.zammad-secure.tls: "true"
      traefik.http.routers.zammad-secure.tls.certresolver: http_resolver
      traefik.http.routers.zammad.entrypoints: web
#      traefik.http.routers.zammad.rule: Host(`${ZAMMAD_DOMAIN}`)
      traefik.http.routers.zammad.rule: Host(`ticket.example.com`)
      traefik.http.services.zammad.loadbalancer.server.port: "8081"
      traefik.http.middlewares.zammad-https-redirect.redirectscheme.scheme: https
      traefik.http.routers.zammad.middlewares: zammad-https-redirect
    networks:
      proxy:
      default:

  zammad-scheduler:
    <<: *zammad-service

  zammad-websocket:
    <<: *zammad-service

volumes:
   zammad-mailer-templates:
      driver: local

networks:
  proxy:
    name: proxy
    external: true
  default:
    name: zammad

compare with your docker-compose.yml of traefik .. it should be also in a network named proxy or change it to your needs.

    networks:
      proxy:
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.