druidfi / stonehenge

Multi-project local development environment & toolset on Docker
MIT License
61 stars 6 forks source link

Traefik 2 #38

Closed back-2-95 closed 4 years ago

back-2-95 commented 5 years ago

Refactor Stonehenge to use Traefik 2. This means changes to:

Maybe some more.

back-2-95 commented 4 years ago

Create 2.x branch for this.

back-2-95 commented 4 years ago

WiP in 2.x branch.

pascalandy commented 4 years ago

Hey, I love your project!!

I'm working hard to migrate my stack on traefik v2. Many due diligence to do as clients depends on my stacks.

Don't be shy to buzz me in the future. I'll be glad to review/propose updates. Meanwhile, I shared many compose files over this conversation that might be useful for this project :)

Cheers!

back-2-95 commented 4 years ago

Thanks @pascalandy !

I still miss error handler where I can show custom error pages to get all the features from 1.x branch using Traefik 1.7. This is what I have currently: https://gist.github.com/back-2-95/ce42754ae29000faaeb3b7df89ae15a3

pascalandy commented 4 years ago

I swear, I have the exact same requirement in my backlog :-p

nginx container with custom html page as errors service

back-2-95 commented 4 years ago

Just a note to myself:

Switching to use v2 is a bit tricky as projects need to change their labels too. That will result projects in different stages and a user jumping some how between v1 and v2.

back-2-95 commented 4 years ago

Fixed this for transition perioid (when users possibly using Traefik 1 or 2):

docker-compose.yml service labels for Traefik 1:

app:
    labels:
      traefik.enable: true
      traefik.port: 8080
      traefik.frontend.rule: "Host:${DRUPAL_HOSTNAME}"
      traefik.frontend.redirect.entryPoint: https

and docker-compose.override.yml service labels for Traefik 2:

app:
    labels:
      - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-app.entrypoints=https"
      - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-app.rule=Host(`${DRUPAL_HOSTNAME}`)"
      - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-app.tls=true"
      - "traefik.http.services.${COMPOSE_PROJECT_NAME}-app.loadbalancer.server.port=8080"
      - "traefik.docker.network=stonehenge-network"