version: "3"

tasks:

  up:
    desc: Start containers
    aliases: [du]
    cmds:
      - printf "%s\n" "{{.DOCKER_CONFIG}}" | docker-compose -f - -p {{.PROJECT}} up -d

  down:
    desc: Stop containers
    aliases: [dd]
    cmds:
      - docker compose -p {{.PROJECT}} down

  restart:
    desc: Restart containers
    aliases: [dr]
    cmds:
      - docker compose -p {{.PROJECT}} restart

  logs:
    desc: Tail logs
    aliases: [dl]
    cmds:
      - docker compose -p {{.PROJECT}} logs -f

  clean:
    desc: Remove containers and volumes
    aliases: [dc]
    cmds:
      - docker compose -p {{.PROJECT}} down -v