version: "3"

vars:
  compose_file: "local-compose.yaml"
  cache_bust:
    sh: "date +%s"

tasks:
  build:
    cmds:
      - docker compose -f {{.compose_file}} build --build-arg CACHE_BUST={{.cache_bust}}
  up:
    cmds:
      - CACHE_BUST={{.cache_bust}} docker compose -f {{.compose_file}} up --build
  start:
    cmds:
      - docker compose -f {{.compose_file}} up -d
  down:
    cmds:
      - docker compose -f {{.compose_file}} down
  clean:
    cmds:
      - docker system prune -f
  push:
    cmds:
      - docker buildx build  --platform linux/amd64,linux/arm64 -t registry.infra.nkode.tech/go-nkode:latest --push .
  exec:
    cmds:
      - docker exec -it cron-nkode bash
