version: "3"
services:
  hastebin:
    image: rlister/hastebin
    environment:
      STORAGE_TYPE: redis
      STORAGE_HOST: hastebinredis
    restart: always
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.hastebin.entrypoints=websecure"
      - "traefik.http.routers.hastebin.rule=Host(`haste.$DOMAIN_NAME`)"
      - "traefik.http.routers.hastebin.tls.certresolver=letsencr"
    logging:
      driver: loki
      options:
        loki-url: "http://localhost:3100/loki/api/v1/push"

  hastebinredis:
    image: redis
    restart: always
    volumes:
      - /srv/hastebin:/data
    labels:
      - "traefik.enable=false"

networks:
  default:
    external:
      name: $DEFAULT_NETWORK