Halo, kalau kamu merasa tulisan saya ngebantu kamu, kamu bisa ucapkan terima kasih lewat saweria .

If you feel this website help you, you can donate at saweria .



What I Used in This Tutorial

  1. Flatcar stable 3602.2.1

  2. Docker v20.10.24 (include in Flatcar)

  3. Cronicle v0.9.23

  4. Traefik v2.10.5

It was easier to setup using docker and traefik.

And I found this github.com/jhuckaby/cronicle nginx issue , the owner docker-cronicle repo, soulteary said it was more easy to use traefik than nginx to serve cronicle.

Since I don’t want to waste time, I try my setup using traefik at first try, and it work without problem.


How To

  1. Create docker-compose.yml
version: "3.8"

services:


  traefik:
    environment:
      - TZ=Asia/Jakarta

    image: traefik:v2.10.5

    ports:
      - target: 80
        published: 80
        mode: host
      - target: 443
        published: 443
        mode: host

    labels:
      - traefik.enable=true
      - traefik.docker.network=traefik-cron
      #enable this to enable traefik dashboard
      # - traefik.http.middlewares.https-redirect.redirectscheme.scheme=https
      # - traefik.http.middlewares.https-redirect.redirectscheme.permanent=true
      # - traefik.http.routers.traefik-cron-http.rule=Host(`traefik.yourdomain.com`)
      # - traefik.http.routers.traefik-cron-http.entrypoints=http
      # - traefik.http.routers.traefik-cron-http.middlewares=https-redirect
      # - traefik.http.routers.traefik-cron-https.rule=Host(`traefik.yourdomain.com`)
      # - traefik.http.routers.traefik-cron-https.entrypoints=https
      # - traefik.http.routers.traefik-cron-https.tls=true
      # - traefik.http.routers.traefik-cron-https.service=api@internal
      # - traefik.http.routers.traefik-cron-https.tls.certresolver=le
      - traefik.http.middlewares.security-headers.headers.hostsproxyheaders=X-Forwarded-Host
      - traefik.http.middlewares.security-headers.headers.sslredirect=true
      - traefik.http.middlewares.security-headers.headers.sslproxyheaders.X-Forwarded-Proto=https
      - traefik.http.middlewares.security-headers.headers.stsseconds=63072000
      - traefik.http.middlewares.security-headers.headers.stsincludesubdomains=true
      - traefik.http.middlewares.security-headers.headers.stspreload=true
      - traefik.http.middlewares.security-headers.headers.forcestsheader=true
      - traefik.http.middlewares.security-headers.headers.framedeny=true
      - traefik.http.middlewares.security-headers.headers.contenttypenosniff=true
      - traefik.http.middlewares.security-headers.headers.browserxssfilter=true
      - traefik.http.middlewares.security-headers.headers.referrerpolicy=same-origin
      - traefik.http.middlewares.security-headers.headers.customresponseheaders.x-robots-tag=noindex, nofollow, nosnippet, noarchive, noimageindex, notranslate
      #enable this to enable traefik dashboard
      # - traefik.http.routers.traefik-cron-https.middlewares=security-headers
      # - traefik.http.services.traefik-cron.loadbalancer.server.port=8080

    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro

    command:
      - --providers.docker=true
      - --providers.docker.exposedbydefault=true
      - --providers.docker.swarmmode=false
      - --entrypoints.http.address=:80
      - --entrypoints.https.address=:443
      - --certificatesresolvers.le.acme.email=you@yourdomain.com
      - --certificatesresolvers.le.acme.tlschallenge=true
      - --api=true

    networks:
      - traefik-cron

  cronicle:
    image: soulteary/cronicle:0.9.23
    expose:
      - 3012

    labels:
      - traefik.enable=true
      - traefik.docker.network=traefik-cron
      - traefik.http.routers.cronicle-http.rule=Host(`cronicle.yourdomain.com`)
      - traefik.http.routers.cronicle-http.entrypoints=http
      - traefik.http.routers.cronicle-http.middlewares=https-redirect
      - traefik.http.routers.cronicle-https.rule=Host(`cronicle.yourdomain.com`)
      - traefik.http.routers.cronicle-https.entrypoints=https
      - traefik.http.routers.cronicle-https.tls=true
      - traefik.http.routers.cronicle-https.tls.certresolver=le
      - traefik.http.routers.cronicle-https.middlewares=security-headersk
      - traefik.http.services.cronicle.loadbalancer.server.port=3012

    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
      - ./data/data:/opt/cronicle/data
      - ./data/logs:/opt/cronicle/logs
      - ./data/plugins:/opt/cronicle/plugins
    extra_hosts:
      - "cronicle.yourdomain.com:0.0.0.0"
    environment:
      - TZ=Asia/Jakarta
      # you can read all available config at
      # https://github.com/jhuckaby/Cronicle/blob/master/docs/Configuration.md
      - HOSTNAME=cronicle.yourdomain.com
      - CRONICLE_foreground=1
      - CRONICLE_echo=1
      - CRONICLE_base_app_url=http://cronicle.yourdomain.com:3012
      - CRONICLE_web_socket_use_hostnames=1
      - CRONICLE_server_comm_use_hostnames=1
      - CRONICLE_WebServer__http_port=3012
      - CRONICLE_WebServer__http_bind_address=0.0.0.0
      - CRONICLE_WebServer__https=0
      - CRONICLE_web_direct_connect=0
      - CRONICLE_smtp_hostname=mail.yourdomain.com
      - CRONICLE_email_from=no-reply@yourdomain.com
      - CRONICLE_smtp_port=587
      - CRONICLE_mail_options__secure=false
      - CRONICLE_mail_options__auth__user=no-reply@yourdomain.com
      - CRONICLE_mail_options__auth__pass=passwordEmail
      - CRONICLE_mail_options__connectionTimeout=10000
      - CRONICLE_mail_options__greetingTimeout=10000
      - CRONICLE_mail_options__socketTimeout=10000
    healthcheck:
      test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider localhost:3012/api/app/ping || exit 1"]
      interval: 5s
      timeout: 1s
      retries: 3

    networks:
      - traefik-cron

networks:
  traefik-cron:  
  1. Run with docker-compose up -d

  2. You should change the default password immediately after installation

This Where You Create Cron

This Where You Create Cron

Crontab Style

Crontab Style

Or You Can Make Schedule To Run Script

Or You Can Make Schedule To Run Script

You Can Send Notif If Cron Success or Failed

You Can Send Notif If Cron Success or Failed

Notif When Schedule Failed

Notif When Schedule Failed

Create Event To Organize Your Schedule

Create Event To Organize Your Schedule

You Can Add New User With Different Role

You Can Add New User With Different Role

You Can Check Cron Stat

You Can Check Cron Stat


Reference:

  1. github.com/jhuckaby/cronicle issue

  2. github.com/soulteary/docker-cronicle