Hi,
i have a Koa.js server running inside a docker image.
The server provides the endpoint /graphql
, on which both http and ws connections can be established. This setup works on localhost, but once i deploy, only the http request gets a response.
I dont know how to configure traefik for ws.
I have here, in order, the docker-compose config for the database(api) image, the traefik instance, and the treafik.toml file.
database:
image: "registry.finnfrotscher.com/x/api.database"
hostname: database
ports:
- "9002:80"
restart: unless-stopped
environment:
NODE_ENV: production
networks:
- localhost
labels:
- traefik.port=80
- traefik.enable=true
- traefik.backend=database
- traefik.docker.network=traefik
- traefik.frontend.entryPoints=http,https
- traefik.frontend.redirect.entryPoint=https
- traefik.frontend.rule=Host:db.x.com
traefik:
image: traefik:maroilles
restart: unless-stopped
ports:
- "80:80"
- "443:443"
networks:
- localhost
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.toml:/traefik.toml
- ./acme.json:/acme.json
labels:
- traefik.port=80
- traefik.backend=traefik
- traefik.frontend.rule=Host:traefik.x.com
- traefik.frontend.entryPoints=http,https
logLevel = "DEBUG"
defaultEntryPoints = ["http", "https"]
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "x.com"
exposedByDefault = false
watch = true
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[acme]
email = "finn@x.com"
storage = "/acme.json"
onHostRule = true
entryPoint = "https"
acmelogging=true
[acme.httpChallenge]
entryPoint = "http"
[[acme.domains]]
main = "x.com"
sans = ["www.x.com", "app.x.com", "db.x.com", "admin.db.x.com"]