Skip to content

deployment notes

Evan Feenstra edited this page May 11, 2020 · 10 revisions

traefik.yaml

api:
  insecure: true # enables the web dash
  
providers:
  docker: {}

entryPoints:
  web:
    address: ":80"

  websecure:
    address: ":443"

  mqtt:
    address: ":8883"

certificatesResolvers:
  myresolver:
    acme:
      email: [email protected]
      storage: acme.json
      caServer: https://acme-staging-v02.api.letsencrypt.org/directory
      dnsChallenge:
        provider: route53

docker-compose.yaml

version: '2'

services:
  reverse-proxy:
    # The official v2 Traefik docker image
    image: traefik:v2.2
    # Enables the web UI and tells Traefik to listen to docker
    # command: --api.insecure=true --providers.docker --configFile=/home/ec2-user/sphinx-deploy/traefik.yaml
    ports:
      # The HTTP port
      - 80:80
      # The Web UI (enabled by --api.insecure=true)
      - 8080:8080
      - 443:5002
    volumes:
      # So that Traefik can listen to the Docker events
      - /var/run/docker.sock:/var/run/docker.sock

  auth:
    image: sphinx-auth
    depends_on:
      - reverse-proxy
    ports:
      - "9090:9090"
    labels:
      - "traefik.http.routers.auth.rule=Host(`auth.docker.localhost`)"
    restart: on-failure

  tribes:
    image: sphinx-tribes
    depends_on:
      - auth
      - reverse-proxy
    ports:
      - "5002:5002"
      - "1883:1883"
    labels:
      - traefik.enable=true
      - traefik.http.routers.tribes.rule=Host(`tribes.sphinx.chat`)
      - traefik.http.services.tribes.loadbalancer.server.port=5002
      - traefik.http.routers.tribes.tls=true
      - traefik.http.routers.tribes.tls.certresolver=myresolver
      - traefik.tcp.routers.tribes.rule=Host(`tribes.sphinx.chat`)
      - traefik.tcp.services.tribes.loadbalancer.server.port=1883
      - traefik.tcp.routers.tribes.tls=true
      - traefik.tcp.routers.tribes.tls.certresolver=myresolver
    restart: on-failure

Clone this wiki locally