Created
October 13, 2018 19:15
-
-
Save SrMouraSilva/3bfa1a5d30d29cdd71b1e622ef2e8ef1 to your computer and use it in GitHub Desktop.
Docker compose traefik com not found!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.7' | |
services: | |
traefik: | |
image: traefik:1.7-alpine # The official Traefik docker image | |
command: > | |
--api | |
--docker | |
--docker.domain=localhost | |
--logLevel=DEBUG | |
# Enables the web UI and tells Træfik to listen to docker | |
ports: | |
- "80:80" # The HTTP port | |
- "8080:8080" # The Web UI (enabled by --api) | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock:ro # So that Traefik can listen to the Docker events | |
labels: | |
- traefik.backend=traefik | |
networks: | |
- ambientes | |
servico1: | |
depends_on: | |
- traefik | |
image: httpd:alpine | |
labels: | |
- traefik.backend=raiz | |
- traefik.frontend.rule=Host:servico1.localhost | |
- traefik.frontend.port=80 | |
networks: | |
- ambientes | |
ambiente-nao-localizado: | |
depends_on: | |
- traefik | |
image: nginx:alpine | |
labels: | |
- traefik.backend=ambiente-nao-encontrado | |
# Baixa prioridade para pegar todos os subdomínios não definidos | |
- traefik.frontend.rule=HostRegexp:{subdomain:.+}.localhost | |
- traefik.frontend.priority=1 | |
- traefik.frontend.port=80 | |
networks: | |
- ambientes | |
volumes: | |
- ./ambiente-nao-localizado:/usr/share/nginx/html:ro | |
# Baseado em | |
# - https://logz.io/blog/docker-logging/ | |
# - https://blog.jhink.com/centralize-docker-logs-using-elastic-stack-e55670bfb714 | |
# - https://github.com/ludekvesely/docker-logspout-elk/blob/master/docker-compose.yml | |
# teste-elk: | |
# image: gliderlabs/logspout | |
# command: syslog+tls://:5000 | |
# volumes: | |
# - /var/run/docker.sock:/var/run/docker.sock:ro | |
networks: | |
ambientes: | |
name: ambientes | |
driver: bridge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment