This is my first time using traefik and letsencrypt, in this case I am just using it to provide secure http to my website, after struggling to string them up together using docker compose, I discover the lock icon(indicating the site is secure is shown in my browser) but the web application traefik is suppose to route to is not run, instead a "Gateway Timeout" text is written to the browser.
here are the setup files.
docker-compose.yml
services:
traefik:
image: traefik:1.7.12
restart: always
ports:
- 80:80
- 443:443
networks:
- web
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.toml:/traefik.toml
- ./acme.json:/acme.json
container_name: traefik
environment:
- "GODADDY_API_KEY=my-godaddy-api-key"
- "GODADDY_API_SECRET=my-godaddy-api-secret"
server:
container_name: my-server
image: my-server-image
expose:
- "8000"
volumes:
- ./:/app
- uploadedFiles:/app/uploaded_files/
environment:
host_server: db
db_server_port: 5432
database_name: mydatabase
db_username: myuser
db_password: mypassword
ssl_mode: prefer
labels:
- "traefik.docker.network=web"
- "traefik.enable=true"
- "traefik.basic.frontend.rule=Host:mydomain.com"
- "traefik.basic.port=8000"
networks:
- postgresqlnet
restart: always
depends_on:
- database
traefik.toml
debug = false
logLevel = "ERROR"
defaultEntryPoints = ["https","http"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[retry]
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "mydomain.com"
watch = true
exposedByDefault = false
[acme]
email = "email@mydomain.com"
storage = "acme.json"
entryPoint = "https"
onHostRule = true
caServer = "https://acme-v02.api.letsencrypt.org/directory"
[acme.httpChallenge]
entryPoint = "http"
[acme.dnsChallenge]
provider = "godaddy"
delayBeforeCheck = 0
[[acme.domains]]