My bad... Now I'm getting the 404 again.
docker-compose.yml:
version: '3.5'
services:
traefik:
image: traefik:v2.10.1
restart: always
ports:
- 80:80
- 443:443
- 8080:8080
command:
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --providers.docker.network=web
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --api.insecure=true
- --certificatesresolvers.le.acme.email=${LETSENCRYPT_MAIL}
- --certificatesresolvers.le.acme.storage=/etc/ssl/certs/acme.json
- --certificatesresolvers.le.acme.tlschallenge=true
- --log.level=DEBUG
- --log.filePath=/etc/traefik/traefik.log
- --log.format=json
labels:
- traefik.enable=true
- traefik.docker.network=web
- traefik.http.routers.traefik.rule=Host(`${DOMAIN_NAME}`)
- traefik.http.routers.traefik.tls.certresolver=le
- traefik.http.routers.traefik.entrypoints=websecure
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /etc/ssl/certs:/etc/ssl/certs
- /etc/traefik:/etc/traefik
networks:
- web
detactive_api:
build: api
restart: always
environment:
- DETACTIVE_DB_URL=${DETACTIVE_DB_URL}
- STICKER_DB_URL=${STICKER_DB_URL}
labels:
- traefik.enable=true
- traefik.docker.network=web
- traefik.http.routers.api.rule=Host(`${DOMAIN_NAME}`) && PathPrefix(`/api`)
- traefik.http.services.api.loadbalancer.server.port=3000
- traefik.http.routers.api.tls.certresolver=le
- traefik.http.routers.api.entrypoints=websecure
depends_on:
- db
networks:
- web
db:
image: postgres
restart: always
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- ./api/db/init.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- internal
pgadmin:
image: dpage/pgadmin4
restart: always
environment:
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL}
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}
labels:
- traefik.enable=true
- traefik.docker.network=web
- traefik.http.routers.pgadmin.rule=Host(`${DOMAIN_NAME}`) && PathPrefix(`/pgadmin`)
- traefik.http.services.pgadmin.loadbalancer.server.port=80
- traefik.http.routers.pgadmin.tls.certresolver=le
- traefik.http.routers.pgadmin.entrypoints=websecure
networks:
- web
- internal
networks:
web:
external: true
internal:
external: false
Logs:
{"entryPointName":"websecure","level":"debug","msg":"Waiting 10s seconds before killing connections.","time":"2023-05-12T17:57:36Z"}
{"entryPointName":"traefik","level":"debug","msg":"Waiting 10s seconds before killing connections.","time":"2023-05-12T17:57:36Z"}
{"entryPointName":"websecure","level":"error","msg":"accept tcp [::]:443: use of closed network connection","time":"2023-05-12T17:57:36Z"}
{"entryPointName":"websecure","level":"error","msg":"Error while starting server: accept tcp [::]:443: use of closed network connection","time":"2023-05-12T17:57:36Z"}
{"entryPointName":"traefik","level":"error","msg":"accept tcp [::]:8080: use of closed network connection","time":"2023-05-12T17:57:36Z"}
{"entryPointName":"traefik","level":"error","msg":"Error while starting server: accept tcp [::]:8080: use of closed network connection","time":"2023-05-12T17:57:36Z"}
{"entryPointName":"traefik","level":"debug","msg":"Entry point traefik closed","time":"2023-05-12T17:57:36Z"}
{"entryPointName":"web","level":"debug","msg":"Waiting 10s seconds before killing connections.","time":"2023-05-12T17:57:36Z"}
{"entryPointName":"websecure","level":"debug","msg":"Entry point websecure closed","time":"2023-05-12T17:57:36Z"}
{"entryPointName":"web","level":"error","msg":"accept tcp [::]:80: use of closed network connection","time":"2023-05-12T17:57:36Z"}
{"entryPointName":"web","level":"error","msg":"Error while starting server: accept tcp [::]:80: use of closed network connection","time":"2023-05-12T17:57:36Z"}
{"entryPointName":"web","level":"debug","msg":"Entry point web closed","time":"2023-05-12T17:57:36Z"}
{"level":"info","msg":"Server stopped","time":"2023-05-12T17:57:36Z"}
{"level":"info","msg":"Shutting down","time":"2023-05-12T17:57:36Z"}
{"level":"info","msg":"Traefik version 2.10.1 built on 2023-04-27T14:52:35Z","time":"2023-05-12T17:57:39Z"}
{"level":"debug","msg":"Static configuration loaded {\"global\":{\"checkNewVersion\":true},\"serversTransport\":{\"maxIdleConnsPerHost\":200},\"entryPoints\":{\"traefik\":{\"address\":\":8080\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":\"10s\"},\"respondingTimeouts\":{\"idleTimeout\":\"3m0s\"}},\"forwardedHeaders\":{},\"http\":{},\"http2\":{\"maxConcurrentStreams\":250},\"udp\":{\"timeout\":\"3s\"}},\"web\":{\"address\":\":80\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":\"10s\"},\"respondingTimeouts\":{\"idleTimeout\":\"3m0s\"}},\"forwardedHeaders\":{},\"http\":{},\"http2\":{\"maxConcurrentStreams\":250},\"udp\":{\"timeout\":\"3s\"}},\"websecure\":{\"address\":\":443\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":\"10s\"},\"respondingTimeouts\":{\"idleTimeout\":\"3m0s\"}},\"forwardedHeaders\":{},\"http\":{},\"http2\":{\"maxConcurrentStreams\":250},\"udp\":{\"timeout\":\"3s\"}}},\"providers\":{\"providersThrottleDuration\":\"2s\",\"docker\":{\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"network\":\"web\",\"swarmModeRefreshSeconds\":\"15s\"}},\"api\":{\"insecure\":true,\"dashboard\":true},\"log\":{\"level\":\"DEBUG\",\"filePath\":\"/etc/traefik/traefik.log\",\"format\":\"json\"},\"certificatesResolvers\":{\"le\":{\"acme\":{\"email\":\"testapp.app@gmail.com\",\"caServer\":\"https://acme-v02.api.letsencrypt.org/directory\",\"storage\":\"/etc/ssl/certs/acme.json\",\"keyType\":\"RSA4096\",\"certificatesDuration\":2160,\"tlsChallenge\":{}}}}}","time":"2023-05-12T17:57:39Z"}
{"level":"info","msg":"\nStats collection is disabled.\nHelp us improve Traefik by turning this feature on :)\nMore details on: https://doc.traefik.io/traefik/contributing/data-collection/\n","time":"2023-05-12T17:57:39Z"}
{"level":"info","msg":"Starting provider aggregator aggregator.ProviderAggregator","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"traefik","level":"debug","msg":"Starting TCP Server","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"web","level":"debug","msg":"Starting TCP Server","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"websecure","level":"debug","msg":"Starting TCP Server","time":"2023-05-12T17:57:39Z"}
{"level":"info","msg":"Starting provider *traefik.Provider","time":"2023-05-12T17:57:39Z"}
{"level":"debug","msg":"*traefik.Provider provider configuration: {}","time":"2023-05-12T17:57:39Z"}
{"level":"debug","msg":"Configuration received: {\"http\":{\"routers\":{\"api\":{\"entryPoints\":[\"traefik\"],\"service\":\"api@internal\",\"rule\":\"PathPrefix(`/api`)\",\"priority\":2147483646},\"dashboard\":{\"entryPoints\":[\"traefik\"],\"middlewares\":[\"dashboard_redirect@internal\",\"dashboard_stripprefix@internal\"],\"service\":\"dashboard@internal\",\"rule\":\"PathPrefix(`/`)\",\"priority\":2147483645}},\"services\":{\"api\":{},\"dashboard\":{},\"noop\":{}},\"middlewares\":{\"dashboard_redirect\":{\"redirectRegex\":{\"regex\":\"^(http:\\\\/\\\\/(\\\\[[\\\\w:.]+\\\\]|[\\\\w\\\\._-]+)(:\\\\d+)?)\\\\/$\",\"replacement\":\"${1}/dashboard/\",\"permanent\":true}},\"dashboard_stripprefix\":{\"stripPrefix\":{\"prefixes\":[\"/dashboard/\",\"/dashboard\"]}}},\"serversTransports\":{\"default\":{\"maxIdleConnsPerHost\":200}}},\"tcp\":{},\"udp\":{},\"tls\":{}}","providerName":"internal","time":"2023-05-12T17:57:39Z"}
{"level":"info","msg":"Starting provider *docker.Provider","time":"2023-05-12T17:57:39Z"}
{"level":"debug","msg":"*docker.Provider provider configuration: {\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"network\":\"web\",\"swarmModeRefreshSeconds\":\"15s\"}","time":"2023-05-12T17:57:39Z"}
{"level":"info","msg":"Starting provider *acme.ChallengeTLSALPN","time":"2023-05-12T17:57:39Z"}
{"level":"debug","msg":"*acme.ChallengeTLSALPN provider configuration: {}","time":"2023-05-12T17:57:39Z"}
{"level":"info","msg":"Starting provider *acme.Provider","time":"2023-05-12T17:57:39Z"}
{"level":"debug","msg":"*acme.Provider provider configuration: {\"email\":\"testapp.app@gmail.com\",\"caServer\":\"https://acme-v02.api.letsencrypt.org/directory\",\"storage\":\"/etc/ssl/certs/acme.json\",\"keyType\":\"RSA4096\",\"certificatesDuration\":2160,\"tlsChallenge\":{},\"ResolverName\":\"le\",\"store\":{},\"TLSChallengeProvider\":{},\"HTTPChallengeProvider\":{}}","time":"2023-05-12T17:57:39Z"}
{"ACME CA":"https://acme-v02.api.letsencrypt.org/directory","level":"debug","msg":"Attempt to renew certificates \"720h0m0s\" before expiry and check every \"24h0m0s\"","providerName":"le.acme","time":"2023-05-12T17:57:39Z"}
{"ACME CA":"https://acme-v02.api.letsencrypt.org/directory","level":"info","msg":"Testing certificate renew...","providerName":"le.acme","time":"2023-05-12T17:57:39Z"}
{"level":"debug","msg":"Configuration received: {\"http\":{},\"tcp\":{},\"udp\":{},\"tls\":{}}","providerName":"le.acme","time":"2023-05-12T17:57:39Z"}
{"level":"debug","msg":"Provider connection established with docker 20.10.21 (API 1.41)","providerName":"docker","time":"2023-05-12T17:57:39Z"}
{"container":"db-server-73b19d3ead292ed1594355d6f0d5281031b0b8c0cd26de4ac98ac42d0586b4ee","level":"debug","msg":"Filtering disabled container","providerName":"docker","time":"2023-05-12T17:57:39Z"}
{"level":"debug","msg":"Configuration received: {\"http\":{\"routers\":{\"api\":{\"entryPoints\":[\"websecure\"],\"service\":\"api\",\"rule\":\"Host(`test-api.testapp.de`) \\u0026\\u0026 PathPrefix(`/api`)\",\"tls\":{\"certResolver\":\"le\"}},\"pgadmin\":{\"entryPoints\":[\"websecure\"],\"service\":\"pgadmin\",\"rule\":\"Host(`test-api.testapp.de`) \\u0026\\u0026 PathPrefix(`/pgadmin`)\",\"tls\":{\"certResolver\":\"le\"}},\"traefik\":{\"entryPoints\":[\"websecure\"],\"service\":\"traefik-server\",\"rule\":\"Host(`test-api.testapp.de`)\",\"tls\":{\"certResolver\":\"le\"}}},\"services\":{\"api\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://172.18.0.2:3000\"}],\"passHostHeader\":true}},\"pgadmin\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://172.18.0.3:80\"}],\"passHostHeader\":true}},\"traefik-server\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://172.18.0.4:80\"}],\"passHostHeader\":true}}}},\"tcp\":{},\"udp\":{}}","providerName":"docker","time":"2023-05-12T17:57:39Z"}
{"level":"debug","msg":"No default certificate, fallback to the internal generated certificate","time":"2023-05-12T17:57:39Z","tlsStoreName":"default"}
{"entryPointName":"traefik","level":"debug","middlewareName":"tracing","middlewareType":"TracingForwarder","msg":"Added outgoing tracing middleware dashboard@internal","routerName":"dashboard@internal","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"dashboard_stripprefix@internal","middlewareType":"StripPrefix","msg":"Creating middleware","routerName":"dashboard@internal","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"dashboard_stripprefix@internal","msg":"Adding tracing to middleware","routerName":"dashboard@internal","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"dashboard_redirect@internal","middlewareType":"RedirectRegex","msg":"Creating middleware","routerName":"dashboard@internal","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"dashboard_redirect@internal","middlewareType":"RedirectRegex","msg":"Setting up redirection from ^(http:\\/\\/(\\[[\\w:.]+\\]|[\\w\\._-]+)(:\\d+)?)\\/$ to ${1}/dashboard/","routerName":"dashboard@internal","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"dashboard_redirect@internal","msg":"Adding tracing to middleware","routerName":"dashboard@internal","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"tracing","middlewareType":"TracingForwarder","msg":"Added outgoing tracing middleware api@internal","routerName":"api@internal","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"traefik-internal-recovery","middlewareType":"Recovery","msg":"Creating middleware","time":"2023-05-12T17:57:39Z"}
{"level":"debug","msg":"Adding certificate for domain(s) test-api.testapp.de","time":"2023-05-12T17:57:39Z"}
{"level":"debug","msg":"No default certificate, fallback to the internal generated certificate","time":"2023-05-12T17:57:39Z","tlsStoreName":"default"}
{"entryPointName":"traefik","level":"debug","middlewareName":"tracing","middlewareType":"TracingForwarder","msg":"Added outgoing tracing middleware api@internal","routerName":"api@internal","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"tracing","middlewareType":"TracingForwarder","msg":"Added outgoing tracing middleware dashboard@internal","routerName":"dashboard@internal","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"dashboard_stripprefix@internal","middlewareType":"StripPrefix","msg":"Creating middleware","routerName":"dashboard@internal","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"dashboard_stripprefix@internal","msg":"Adding tracing to middleware","routerName":"dashboard@internal","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"dashboard_redirect@internal","middlewareType":"RedirectRegex","msg":"Creating middleware","routerName":"dashboard@internal","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"dashboard_redirect@internal","middlewareType":"RedirectRegex","msg":"Setting up redirection from ^(http:\\/\\/(\\[[\\w:.]+\\]|[\\w\\._-]+)(:\\d+)?)\\/$ to ${1}/dashboard/","routerName":"dashboard@internal","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"dashboard_redirect@internal","msg":"Adding tracing to middleware","routerName":"dashboard@internal","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"traefik-internal-recovery","middlewareType":"Recovery","msg":"Creating middleware","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"websecure","level":"debug","middlewareName":"pipelining","middlewareType":"Pipelining","msg":"Creating middleware","routerName":"pgadmin@docker","serviceName":"pgadmin","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"websecure","level":"debug","msg":"Creating load-balancer","routerName":"pgadmin@docker","serviceName":"pgadmin","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"websecure","level":"debug","msg":"Creating server 0 http://172.18.0.3:80","routerName":"pgadmin@docker","serverName":0,"serviceName":"pgadmin","time":"2023-05-12T17:57:39Z"}
{"level":"debug","msg":"child http://172.18.0.3:80 now UP","time":"2023-05-12T17:57:39Z"}
{"level":"debug","msg":"Propagating new UP status","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"websecure","level":"debug","middlewareName":"tracing","middlewareType":"TracingForwarder","msg":"Added outgoing tracing middleware pgadmin","routerName":"pgadmin@docker","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"websecure","level":"debug","middlewareName":"pipelining","middlewareType":"Pipelining","msg":"Creating middleware","routerName":"traefik@docker","serviceName":"traefik-server","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"websecure","level":"debug","msg":"Creating load-balancer","routerName":"traefik@docker","serviceName":"traefik-server","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"websecure","level":"debug","msg":"Creating server 0 http://172.18.0.4:80","routerName":"traefik@docker","serverName":0,"serviceName":"traefik-server","time":"2023-05-12T17:57:39Z"}
{"level":"debug","msg":"child http://172.18.0.4:80 now UP","time":"2023-05-12T17:57:39Z"}
{"level":"debug","msg":"Propagating new UP status","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"websecure","level":"debug","middlewareName":"tracing","middlewareType":"TracingForwarder","msg":"Added outgoing tracing middleware traefik-server","routerName":"traefik@docker","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"websecure","level":"debug","middlewareName":"pipelining","middlewareType":"Pipelining","msg":"Creating middleware","routerName":"api@docker","serviceName":"api","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"websecure","level":"debug","msg":"Creating load-balancer","routerName":"api@docker","serviceName":"api","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"websecure","level":"debug","msg":"Creating server 0 http://172.18.0.2:3000","routerName":"api@docker","serverName":0,"serviceName":"api","time":"2023-05-12T17:57:39Z"}
{"level":"debug","msg":"child http://172.18.0.2:3000 now UP","time":"2023-05-12T17:57:39Z"}
{"level":"debug","msg":"Propagating new UP status","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"websecure","level":"debug","middlewareName":"tracing","middlewareType":"TracingForwarder","msg":"Added outgoing tracing middleware api","routerName":"api@docker","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"websecure","level":"debug","middlewareName":"traefik-internal-recovery","middlewareType":"Recovery","msg":"Creating middleware","time":"2023-05-12T17:57:39Z"}
{"entryPointName":"websecure","level":"debug","msg":"Adding route for test-api.testapp.de with TLS options default","time":"2023-05-12T17:57:39Z"}
{"ACME CA":"https://acme-v02.api.letsencrypt.org/directory","level":"debug","msg":"Trying to challenge certificate for domain [test-api.testapp.de] found in HostSNI rule","providerName":"le.acme","routerName":"api@docker","rule":"Host(`test-api.testapp.de`) \u0026\u0026 PathPrefix(`/api`)","time":"2023-05-12T17:57:39Z"}
{"ACME CA":"https://acme-v02.api.letsencrypt.org/directory","level":"debug","msg":"Trying to challenge certificate for domain [test-api.testapp.de] found in HostSNI rule","providerName":"le.acme","routerName":"pgadmin@docker","rule":"Host(`test-api.testapp.de`) \u0026\u0026 PathPrefix(`/pgadmin`)","time":"2023-05-12T17:57:39Z"}
{"ACME CA":"https://acme-v02.api.letsencrypt.org/directory","level":"debug","msg":"Trying to challenge certificate for domain [test-api.testapp.de] found in HostSNI rule","providerName":"le.acme","routerName":"traefik@docker","rule":"Host(`test-api.testapp.de`)","time":"2023-05-12T17:57:39Z"}
{"ACME CA":"https://acme-v02.api.letsencrypt.org/directory","level":"debug","msg":"Looking for provided certificate(s) to validate [\"test-api.testapp.de\"]...","providerName":"le.acme","routerName":"traefik@docker","rule":"Host(`test-api.testapp.de`)","time":"2023-05-12T17:57:39Z"}
{"ACME CA":"https://acme-v02.api.letsencrypt.org/directory","level":"debug","msg":"No ACME certificate generation required for domains [\"test-api.testapp.de\"].","providerName":"le.acme","routerName":"traefik@docker","rule":"Host(`test-api.testapp.de`)","time":"2023-05-12T17:57:39Z"}
{"ACME CA":"https://acme-v02.api.letsencrypt.org/directory","level":"debug","msg":"Looking for provided certificate(s) to validate [\"test-api.testapp.de\"]...","providerName":"le.acme","routerName":"api@docker","rule":"Host(`test-api.testapp.de`) \u0026\u0026 PathPrefix(`/api`)","time":"2023-05-12T17:57:39Z"}
{"ACME CA":"https://acme-v02.api.letsencrypt.org/directory","level":"debug","msg":"No ACME certificate generation required for domains [\"test-api.testapp.de\"].","providerName":"le.acme","routerName":"api@docker","rule":"Host(`test-api.testapp.de`) \u0026\u0026 PathPrefix(`/api`)","time":"2023-05-12T17:57:39Z"}
{"ACME CA":"https://acme-v02.api.letsencrypt.org/directory","level":"debug","msg":"Looking for provided certificate(s) to validate [\"test-api.testapp.de\"]...","providerName":"le.acme","routerName":"pgadmin@docker","rule":"Host(`test-api.testapp.de`) \u0026\u0026 PathPrefix(`/pgadmin`)","time":"2023-05-12T17:57:39Z"}
{"ACME CA":"https://acme-v02.api.letsencrypt.org/directory","level":"debug","msg":"No ACME certificate generation required for domains [\"test-api.testapp.de\"].","providerName":"le.acme","routerName":"pgadmin@docker","rule":"Host(`test-api.testapp.de`) \u0026\u0026 PathPrefix(`/pgadmin`)","time":"2023-05-12T17:57:39Z"}
{"level":"debug","msg":"Serving default certificate for request: \"\"","time":"2023-05-12T17:58:16Z"}