services:
  php-fpm:
    build:
      context: .
      dockerfile: .docker/php/Dockerfile
    volumes:
      - app-storage:/var/www/storage/app
      - app-public-img:/var/www/public/img
    env_file: .env
    depends_on:
      - mariadb

  nginx:
    image: nginx:1.25-alpine
    volumes:
      - .docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
      - app-storage:/var/www/storage/app
      - app-public-img:/var/www/public/img
    depends_on:
      - php-fpm

  mariadb:
    image: mariadb:10.6
    volumes:
      - db-data:/var/lib/mysql
      - ./humicpro_gizibalita.sql:/docker-entrypoint-initdb.d/humicpro_gizibalita.sql
    environment:
      MARIADB_ROOT_PASSWORD: ${DB_PASSWORD}
      MARIADB_DATABASE: ${DB_DATABASE}
      MARIADB_USER: ${DB_USERNAME}
      MARIADB_PASSWORD: ${DB_PASSWORD}

volumes:
  app-storage:
  app-public-img:
  db-data:
