version: '3.8'

services:
  mysql:
    image: mysql:8.0
    container_name: avusturya_gezi_mysql
    restart: unless-stopped
    environment:
      MYSQL_DATABASE: avusturya_gezi
      MYSQL_ROOT_PASSWORD: root
      MYSQL_PASSWORD: root
      MYSQL_USER: avusturya
    ports:
      - "3306:3306"
    volumes:
      - mysql_data:/var/lib/mysql
    networks:
      - avusturya_gezi_network

  php:
    image: php:8.2-fpm
    container_name: avusturya_gezi_php
    restart: unless-stopped
    working_dir: /var/www/html
    volumes:
      - .:/var/www/html
    networks:
      - avusturya_gezi_network
    depends_on:
      - mysql

  nginx:
    image: nginx:alpine
    container_name: avusturya_gezi_nginx
    restart: unless-stopped
    ports:
      - "8000:80"
    volumes:
      - .:/var/www/html
      - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
    networks:
      - avusturya_gezi_network
    depends_on:
      - php
      - mysql

volumes:
  mysql_data:

networks:
  avusturya_gezi_network:
    driver: bridge
