[Docker-compose + Traefik v2.2] How to prevent "No default certificate, generating one"

How to prevent “No default certificate, generating one” to happen? I am using docker-compose and tried creating a persistent volume in docker and save acme.json to it, but i don’t know if i am doing something wrong here.

I am a front-end dev, so all this is very new to me…

version: "3"

services:

  app:

    build: .

    command: yarn start

    labels:

      - traefik.http.services.app.loadbalancer.server.port=5000

      - traefik.http.routers.app.rule=Host(`mydomain.com.br`)

      - traefik.http.routers.app.tls.certresolver=le

      - traefik.http.routers.app.entrypoints=websecure

  reverse-proxy:

    image: "traefik:v2.2"

    labels:

      - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"

      - "traefik.http.routers.redirs.rule=hostregexp(`{host:.+}`)"

      - "traefik.http.routers.redirs.entrypoints=web"

      - "traefik.http.routers.redirs.middlewares=redirect-to-https"

    command: 

      - --log.level=DEBUG

      - --entrypoints.web.address=:80

      - --entrypoints.websecure.address=:443

      - --certificatesresolvers.le.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory

      - --certificatesresolvers.le.acme.email=myemail@gmail.com

      - --certificatesresolvers.le.acme.storage=/letsencrypt/acme.json

      - --certificatesresolvers.le.acme.tlschallenge=true

      - --certificatesResolvers.le.acme.httpChallenge.entryPoint=web

      - --providers.docker=true

    volumes:

      - /var/run/docker.sock:/var/run/docker.sock

      - acme-volume:/letsencrypt

    ports:

      - "80:80"

      - "443:443"

      - "8080:8080"

volumes:

  acme-volume:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.