services:
  mariadb:
    image: mariadb:10.9
    environment:
      MYSQL_ROOT_PASSWORD: rootpassword
      MYSQL_DATABASE: superarc
      MYSQL_USER: admin
      MYSQL_PASSWORD: yourpassword
    volumes:
      - mariadb_data:/var/lib/mysql
    ports:
      - "3306:3306"
    restart: always

  nginx:
    image: nginx:stable
    volumes:
      - ./frontend:/usr/share/nginx/html:ro
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
    network_mode: "host"
    depends_on:
      - mariadb
      - php-fpm

  php-fpm:
    build:
      context: .
      dockerfile: Dockerfile.php
    volumes:
      - ./frontend:/usr/share/nginx/html
    network_mode: "host"

  main:
    build:
      context: .
      dockerfile: Dockerfile
    network_mode: "host"
    volumes:
      - ./config.ini:/app/config.ini:ro
      - /etc/machine-id:/etc/machine-id:ro
    depends_on:
      - mariadb


volumes:
  mariadb_data:
