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.