docker-compose file with traefik
hi i would like use your docker image with tje reverse proxy traefik (https://traefik.io/). i tried another image with this proxy , but it always was with one port redirection. It ran well. Like this image uses multiple ports, i don't know how to build my docker-compose file. Do you have an idea to do this ? thanks a lot best regards
I've never used Traefik, but it looks pretty cool. Can you post an example docker-compose.yml that you've tried?
this runs :
version: '2' services: proxy: image: traefik networks: - traefik ports: - "80:80" - "8080:8080" - "443:443" volumes: - "./traefik.toml:/etc/traefik/traefik.toml" - "./acme:/etc/traefik/acme" - /var/run/docker.sock:/var/run/docker.sock restart: unless-stopped labels: - "traefik.frontend.rule=Host:traefik.domaine.com" - "traefik.port=8080" - "traefik.backend=traefik" - "traefik.frontend.entryPoints=http,https"
portainer: image: portainer/portainer networks: - traefik labels: - "traefik.frontend.rule=Host:portainer.domaine.com" - "traefik.port=9000" - "traefik.backend=portainer" - "traefik.frontend.entryPoints=http,https" volumes: - "/var/run/docker.sock:/var/run/docker.sock" restart: unless-stopped
networks: traefik: external: name: traefik
This github project was my source : https://github.com/pabardina/docker-traefik-gitlab
I have the web admin working with this proxy, but i didn't have the android apps to work with traefik, if it's a direct connexion it's working, so strange
version: "2"
services:
blynk:
image: mpherg/blynk-server:latest
container_name: blynk
restart: unless-stopped
expose:
- 8080
- 8441
- 9443
volumes:
- config:/data
networks:
- web
labels:
- "traefik.docker.network=web"
- "traefik.enable=true"
- "traefik.frontend.rule=Host:blynk.exemple.org"
- "traefik.port=9443"
- "traefik.protocol=https"
volumes:
config:
networks:
web:
external: true
@wanoo do you have a separate docker-compose.yml for the traefik container? I don't see it in your post. As-is it looks like I need to go create the web external network, which is fine, but I think it is more useful if we can also see your traefik configuration.
Thanks!
of course :
version: '2.1'
services:
traefik:
image: traefik:1.6.5
restart: always
ports:
- 80:80
- 443:443
networks:
- web
- default
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.toml:/traefik.toml
- ./acme.json:/acme.json
container_name: traefik
hostname: traefik
labels:
- "traefik.enable=true"
- "traefik.backend=traefik"
- "traefik.frontend.rule=Host:monitor.exemple.org"
- "traefik.port=8080"
- "traefik.docker.network=web"
networks:
web:
external: true
You have to understand with traefik i have acces to the admin ui, but with the app no connexion, if i open the port 9443 on the blynk docker and NAT, on my firewall, the connexion with the app work.
I tried with caddy and nginx same issue.
Thanks