version: "3"

dotenv: [".env"]

vars:
  PROJECT: nalu_b2b
  BUILD_DIR: ./bin

  REMOTE_USER: root
  REMOTE_HOST: dc02-de
  EMAIL_SMTP_PORT: 1025
  EMAIL_SMTP_HOST: localhost

  LOCAL_DB_SERVICE: db
  LOCAL_DB_USER: nalu
  LOCAL_DB_NAME: nalu
  LOCAL_DB_PASSWORD: Maal12345678
  DUMP_FILE_NAME: 
    sh: echo nalu_$(date +%Y_%m_%d__%H_%M_%S).sql
  REMOTE_DB_SERVICE: "www_naluconcept_com_nalu_db"
  REMOTE_DB_NAME: "presta"
  REMOTE_DB_USER: "presta"
  REMOTE_DB_PASS: "presta"
  DOCKER_CONFIG: |
    services:
      {{.LOCAL_DB_SERVICE}}:
        image: mariadb:latest
        container_name: {{.LOCAL_DB_SERVICE}}
        command: 
          - --innodb_buffer_pool_size=134217728
          - --key_buffer_size=33554432
          - --query_cache_type=1
          - --query_cache_size=67108864
          - --query-cache-strip-comments=1
          - --max-connections=256
          - --event_scheduler=1
          - --log-bin=binlog
          - --log_bin_trust_function_creators=1
        ports:
          - "3306:3306"
        volumes:
          - db_data:/var/lib/mysql
        environment:
          MYSQL_ROOT_PASSWORD: {{.LOCAL_DB_PASSWORD}}
          MYSQL_DATABASE: {{.LOCAL_DB_NAME}}
          MARIADB_USER: {{.LOCAL_DB_USER}}
          MARIADB_PASSWORD: {{.LOCAL_DB_PASSWORD}}
          TZ: CET-1CES
        restart: always
      pdf:
        image: registry.ma-al.com/print-rs:latest
        command: start_server
        ports:
          - "8000:8000"
        restart: always
        cap_add:
          - SYS_ADMIN
        environment:
          - TZ=CET-1CES
      mailpit:
        image: axllent/mailpit
        container_name: mailpit
        restart: unless-stopped
        volumes:
          - mailpit_data:/data/tests
        ports:
          - 8025:8025
          - 1025:1025
        environment:
          MP_MAX_MESSAGES: 5000
          MP_DATABASE: /data/tests/mailpit.db
          MP_SMTP_AUTH_ACCEPT_ANY: true
          MP_SMTP_AUTH_ALLOW_INSECURE: true
          MP_ENABLE_SPAMASSASSIN: postmark
          MP_VERBOSE: true
      meilisearch:
        image: getmeili/meilisearch:latest
        container_name: meilisearch
        restart: unless-stopped
        ports:
          - 7700:7700
        volumes:
          - meilisearch:/data.ms
        environment:
          MEILI_MASTER_KEY: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
         

    volumes:
      db_data:
      mailpit_data:
      meilisearch:  


includes:
  docker: ./taskfiles/docker.yml
  dev: ./taskfiles/dev.yml
  build: ./taskfiles/build.yml
  db: ./taskfiles/db.yml
  nalu: ./taskfiles/nalu_db.yml
  i18n: ./taskfiles/i18n.yml
  tpl: ./taskfiles/templates.yml

tasks:
  default:
    desc: List all available tasks
    cmds:
      - task --list
