diff --git a/docker-compose.yml b/docker-compose.yml index f35659f5..97f36d3c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,10 +6,21 @@ services: - infra labels: - "traefik.enable=true" - - "traefik.http.routers.klz-cables.rule=Host(klz-cables.com,www.klz-cables.com,staging.klz-cables.com)" + + # HTTP → HTTPS redirect + - "traefik.http.routers.klz-cables-web.rule=Host(`klz-cables.com`) || Host(`www.klz-cables.com`)" + - "traefik.http.routers.klz-cables-web.entrypoints=web" + - "traefik.http.routers.klz-cables-web.middlewares=redirect-https" + + # HTTPS router + - "traefik.http.routers.klz-cables.rule=Host(`klz-cables.com`) || Host(`www.klz-cables.com`)" - "traefik.http.routers.klz-cables.entrypoints=websecure" - "traefik.http.routers.klz-cables.tls.certresolver=le" - "traefik.http.services.klz-cables.loadbalancer.server.port=3000" + + # compression + - "traefik.http.routers.klz-cables.middlewares=compress" + healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/health"] interval: 10s @@ -19,5 +30,4 @@ services: networks: infra: - name: infra external: true