services:
  nginx:
    image: nginx:latest
    ports:
      - "8080:80"
    volumes:
      - ./src:/var/www/html
      - ./nginx.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - php

  php:
    build: .
    env_file:
      - .env
    volumes:
      - ./src:/var/www/html
      - ./sessions:/var/lib/php/sessions

  db:
    image: mariadb:10.5
    container_name: my_mariadb
    restart: always
    env_file:
      - .env
    ports:
      - "${MYSQL_PORT}:3306"
    volumes:
      - db_data:/var/lib/mysql

volumes:
  db_data: