Running two httpd apache behind the same traeffik

Hello to achieve 0 downtime during migration I would like to be able to run two http docker (and release and a new one) behind traefik and keep stikyness sessions, and when the new one is ok pu the old down.

I pretty new to traefik , and I 'm not sure I've udnerstood all the cocnept in v2.

I use focker compsoe for traefik

and two docker compsoe with --project-name to identify the release of the httpd container

I've succeded to make one running but when I put the second live traffik stop to deliver the page and make an error saying

here my traefik .toml

[root@microserver v3]# vi traefik.toml
[api]

[entryPoints]
    [entryPoints.http]
     address = ":80"
################################################################
# Docker configuration backend
################################################################
[docker]
 domain = "microserver"
 watch = true
 exposedbydefault = true


[providers.docker]
 endpoint = "unix:///var/run/docker.sock"

Here my docker-compose.yml for traefik

version: '3'

services:
 loadbalancer:
  image: "traefik:v2.2"
  command:
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=true"
      - "--entrypoints.web.address=:80"
  ports:
   - "192.168.1.235:80:80"
   - "192.168.1.235:8080:8080"
  volumes:
 #  - /opt/web/apache/1000-stack/docker/v3/traefik.toml:/etc/traefik/traefik.toml
   - /var/run/docker.sock:/var/run/docker.sock

and here my last test for docker compose httpd

version: '3'

services:
 apache-1000:
   build: ./
   labels:
     - "traefik.enable=true"
     - "traefik.backend=apache_1000"
     - "traefik.backend.healthcheck.path=/health"
     - "traefik.backend.healthcheck.interval=1s"
    # - "traefik.http.routers.apache1000.entrypoints=web"
   # 2 - "traefik.http.routers.apache1000.rule=Host(`microserver`)"
     - "traefik.frontend.rule=Host(`microserver`)"
   volumes:
     - /data/site-1000/:/usr/local/apache2/htdocs/
     - /opt/web/apache/1000-stack/conf/:/usr/local/apache2/conf/
     - /var/log/web/apache/1000-stack/:/usr/local/apache2/logs/


my server dns is microserver runnind under 192.168.1.235

I don't know why the router host doesn't take my Host match(I guess it's because of that I get 4040 when I access to http://microserver) and I don't know why it doesn't put the whole stuff under one service and create two service?

I launch my docker for http with this command

 docker-compose --project-name=test2 up -d
 docker-compose --project-name=test1 up -d

thank you for your help.

Hello,

you are mixing Traefik v1 and Traefik v2 configuration.

Recommend read:

thank you for your info I reread the thing and try this in myu http docker-compose.yml


version: '3'

services:
 apache-1000:
   build: ./
   labels:
     - "traefik.enable=true"
    # - "traefikbackend=apache_1000"
    # - "traefik.backend.healthcheck.path=/health"
    # - "traefik.backend.healthcheck.interval=1s"
    # - "traefik.http.routers.apache1000.entrypoints=web"
    # - "traefik.http.routers.apache1000.rule=Host(`microserver`)"
    # - "traefik.apache1000.frontend.rule=Host(`microserver`)"
     - "traefik.http.routers.my-app.rule=Host(`microserver`)"

   volumes:
     - /data/site-1000/:/usr/local/apache2/htdocs/
     - /opt/web/apache/1000-stack/conf/:/usr/local/apache2/conf/
     - /var/log/web/apache/1000-stack/:/usr/local/apache2/logs/

But I lost the info in the rooter and servcie is still nto aggreated:

It seem basic but it get me crazy two night on on this ...

I've managed to get something look more correct under traefik but I don't find how I can put the docker into the services?

Services defintion in toml require serverurl and port (which I would like to be autodiscover through docker)

I narrowed it I guess, I was able to get an answer if I remove the project-name and One httpd instance only (or if I use scale on docker compose) but nwhen I add a project-name it ignore my Hosts and create a specific one with the name of the --project-name args