version: '3.8'

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    image: php:8.2-apache
    container_name: wedding
    volumes:
      - ./src:/var/www/html
      - ./php.ini:/usr/local/etc/php/php.ini
    ports:
      - "80:80"
    networks:
      - wedding-network
    depends_on:
      - db

  db:
    image: mysql:8.0
    container_name: wedding_db
    environment:
      MYSQL_ROOT_PASSWORD: rootsqlserver
      MYSQL_DATABASE: wedding_db
      MYSQL_USER: mysql
      MYSQL_PASSWORD: sqlserver
    ports:
      - "3306:3306"
    volumes:
      - db_data:/var/lib/mysql
    networks:
      - wedding-network

networks:
  wedding-network:

volumes:
  db_data: