version: "3.8" # Updated version
services:
  mariadb:
    image: mariadb:10.8
    command:
      - --character-set-server=utf8mb4
      - --collation-server=utf8mb4_unicode_ci
      - --skip-character-set-client-handshake
      - --skip-innodb-read-only-compressed # Temporary fix for MariaDB 10.6
    environment:
      MYSQL_ROOT_PASSWORD: 123
    volumes:
      - mariadb-data:/var/lib/mysql
    networks:
      - johnny_net

  redis:
    image: redis:alpine
    networks:
      - johnny_net

  frappe:
    image: frappe/bench:latest
    command: bash /workspace/init.sh
    environment:
      - SHELL=/bin/bash
    working_dir: /home/frappe
    volumes:
      - .:/workspace
    networks:
      johnny_net:
        aliases:
          - hrm-backend
        ipv4_address: 172.23.0.10

volumes:
  mariadb-data:

networks:
  johnny_net:
    external: true
