Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On redeploy traefik deletes route #7

Closed
atlekbai opened this issue May 3, 2019 · 6 comments
Closed

On redeploy traefik deletes route #7

atlekbai opened this issue May 3, 2019 · 6 comments

Comments

@atlekbai
Copy link

atlekbai commented May 3, 2019

Hello!
When running docker stack deploy ... the second time, traefik deletes its route to url.
For example, I deployed first-time nginx server on host example.com, after redeploy, example.com shows 404 page.

How to fix this issue?

my yaml file:

version: '3.3'

volumes:
    web_data: {}

networks:
  net:
    driver: overlay
    attachable: true
  traefik-public:
    external: true

services:
  web:
    image: *****
    networks:
      - net
      - default
      - traefik-public
    environment:
      - DB_TYPE=mysql
      - DB_HOST=mysql
      - DB_DATABASE=****
      - DB_USERNAME=***
      - DB_PASSWORD=****
    volumes:
      - web_data:/var/www/html/storage/app
    deploy:
      mode: replicated
      replicas: 3
      labels:
        - traefik.frontend.rule=Host:example.com
        - traefik.enable=true
        - traefik.tags=${TRAEFIK_PUBLIC_TAG:-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

@ghost
Copy link

ghost commented May 3, 2019

Maybe you have forgotten to export the enviroment variables?

@atlekbai
Copy link
Author

atlekbai commented May 3, 2019

Maybe you have forgotten to export the enviroment variables?

No, the same yaml file. When I try to redeploy it, its host will show 404

@ghost
Copy link

ghost commented May 3, 2019

Yeah same file but are the enviroment variables still present when you "echo" them. So try to

EXPORT=...

again to maybe solve the problem :-)

@atlekbai
Copy link
Author

atlekbai commented May 4, 2019

I solved the problem deploying with flag --with-registry-auth.

@atlekbai atlekbai closed this as completed May 4, 2019
@tiangolo
Copy link
Owner

Thanks for your help @noobcoder1983 . Good points.

I'm glad you solved your problem @atlekbai . Thanks for reporting back and closing the issue.

@ghost
Copy link

ghost commented May 10, 2019

Thank you @tiangolo. It was my pleasure. Great that it works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants