Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: '3'
- services:
- traefik:
- image: traefik # The official Traefik docker image
- container_name: traefik-docker-compose
- restart: always
- command: --api --docker
- labels:
- - "traefik.enable=true"
- - "traefik.port=8080"
- ports:
- - "80:80" # The HTTP port
- - "443:443"
- - "8080:8080" # The Web UI (enabled by --api)
- volumes:
- - /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
- - /opt/traefik/traefik.toml:/traefik.toml
- - /opt/traefik/log:/var/log/traefik
- labels:
- - "traefik.frontend.rule=Host:traefik.observer.localhost"
- whoami:
- image: emilevauge/whoami # A container that exposes an API to show its IP address
- container_name: whoami-docker-compose
- labels:
- - "traefik.frontend.rule=Host:whoami.observer.localhost"
- api:
- image: 163.83.21.153:5000/php:apiSSL
- container_name: api-docker-compose
- restart: always
- expose:
- - "443"
- volumes:
- - /volumes/api:/var/www/html
- labels:
- - "traefik.enable=true"
- - "traefik.basic.frontend.rule=Host:api.observer.localhost"
- - traefik.protocol=https
- - traefik.basic.port=443
- ################################################################
- # Global configuration
- ################################################################
- # Enable debug mode
- #
- # Optional
- # Default: false
- #
- debug = true
- # Log level
- #
- # Optional
- # Default: "ERROR"
- #
- logLevel = "DEBUG"
- # Entrypoints to be used by frontends that do not specify any entrypoint.
- # Each frontend can specify its own entrypoints.
- #
- # Optional
- # Default: ["http"]
- #
- defaultEntryPoints = ["https", "http"]
- ################################################################
- # Entrypoints configuration
- ################################################################
- # Entrypoints definition
- #
- # Optional
- # Default:
- [entryPoints]
- [entryPoints.http]
- address = ":80"
- # [entryPoints.http.redirect]
- # entryPoint = "https"
- [entryPoints.https]
- address = ":443"
- [entryPoints.https.tls]
- ################################################################
- # Traefik logs configuration
- ################################################################
- # Traefik logs
- # Enabled by default and log to stdout
- #
- # Optional
- #
- [traefikLog]
- # Sets the filepath for the traefik log. If not specified, stdout will be used.
- # Intermediate directories are created if necessary.
- #
- # Optional
- # Default: os.Stdout
- #
- # filePath = "log/traefik.log"
- # Format is either "json" or "common".
- #
- # Optional
- # Default: "common"
- #
- # format = "common"
- ################################################################
- # API and dashboard configuration
- ################################################################
- # Enable API and dashboard
- [api]
- # Name of the related entry point
- #
- # Optional
- # Default: "traefik"
- #
- entryPoint = "traefik"
- # Enabled Dashboard
- #
- # Optional
- # Default: true
- #
- # dashboard = false
- ################################################################
- # Ping configuration
- ################################################################
- # Enable ping
- [ping]
- # Name of the related entry point
- #
- # Optional
- # Default: "traefik"
- #
- # entryPoint = "traefik"
- ################################################################
- # Docker configuration backend
- ################################################################
- # Enable Docker configuration backend
- [docker]
- # Docker server endpoint. Can be a tcp or a unix socket endpoint.
- #
- # Required
- # Default: "unix:///var/run/docker.sock"
- #
- # endpoint = "tcp://10.10.10.10:2375"
- # Default domain used.
- # Can be overridden by setting the "traefik.domain" label on a container.
- #
- # Optional
- # Default: ""
- #
- domain = "observer.localhost"
- watch = true
- exposedByDefault = false
- # Expose containers by default in traefik
- #
- # Optional
- # Default: true
- #
- # exposedByDefault = true
Add Comment
Please, Sign In to add comment