name: resoluteos

services:
  traefik:
    image: traefik:latest
    container_name: traefik
    restart: unless-stopped
    command:
      - --accesslog=true
      - --api.dashboard=true
      - --api.insecure=true
      - --certificatesresolvers.letsencrypt.acme.email=${LETSENCRYPT_EMAIL}
      - --certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web
      - --certificatesresolvers.letsencrypt.acme.httpchallenge=true
      - --certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json
      - --certificatesresolvers.letsencrypt.acme.tlschallenge=true
      - --entrypoints.web.address=:80
      - --entrypoints.web.http.redirections.entryPoint.scheme=https
      - --entrypoints.web.http.redirections.entryPoint.to=websecure
      - --entrypoints.websecure.address=:443
      - --entrypoints.websecure.http.tls.certResolver=letsencrypt
      - --global.checkNewVersion=false
      - --global.sendAnonymousUsage=false
      - --log.level=ERROR
      - --providers.docker.exposedbydefault=false
      - --providers.docker=true
    environment:
      - TZ
      - HTTP_PROXY
      - HTTPS_PROXY
      - NO_PROXY
    ports:
      - 80:80
      - 443:443
      - 8080:8080
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - letsencrypt:/letsencrypt

  rmm-server:
    image: registry.inuvika.com/rmm/rmm-server${RMM_VERSION:-:latest}
    platform: linux/amd64
    container_name: rmm-server
    restart: unless-stopped
    ports:
      - 8090:8090
    links:
      - rmm-updater
    volumes:
      - pb_data:/app/pb_data
      - pb_iso:/app/iso
    environment:
      - PB_ENCRYPTION_KEY
      - TZ
      - HTTP_PROXY
      - HTTPS_PROXY
      - NO_PROXY
    labels:
      - traefik.enable=true
      - traefik.http.routers.rmm-server.rule=Host(`${API_HOSTNAME}`)
      - traefik.http.routers.rmm-server.entrypoints=websecure
      - traefik.http.services.rmm-server.loadbalancer.server.port=8090

  rmm-updater:
    image: registry.inuvika.com/rmm/rmm-updater${RMM_VERSION:-:latest}
    platform: linux/amd64
    restart: unless-stopped
    container_name: rmm-updater
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    labels:
      - com.centurylinklabs.watchtower.enable=true
    environment:
      - TZ
      - HTTP_PROXY
      - HTTPS_PROXY
      - NO_PROXY

  watchtower:
    image: beatkind/watchtower:latest
    restart: unless-stopped
    container_name: watchtower
    labels:
      - org.opencontainers.image.vendor=devcdn.net
      - org.opencontainers.image.url=https://watchtower.devcdn.net/
      - org.opencontainers.image.title=Watchtower
      - org.opencontainers.image.description=A container-based solution for automating Docker container base image updates.
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - WATCHTOWER_CLEANUP=true
      - WATCHTOWER_SCHEDULE=${WATCHTOWER_SCHEDULE:-@daily}
      - WATCHTOWER_LABEL_ENABLE=true
      - TZ

volumes:
  pb_data:
  pb_iso:
  letsencrypt:
