services:
  ziad_db:
    image: mysql:8.0
    container_name: ziad-laravel-template-db
    ports:
      - "3302:3306"
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_DATABASE=ziad_laravel_template
    volumes:
      - ziad_db_data:/var/lib/mysql
    networks:
      - ziad_net
  ziad_php:
    build: .
    user: "1000:1000"
    volumes:
      - ./:/var/www/html
    depends_on:
      ziad_db:
        condition: service_started
    networks:
      - ziad_net
  ziad_webserver_nginx:
    image: nginx:stable-alpine
    ports:
      - "8001:80"
      - "8002:443"
    volumes:
      - ./:/var/www/html:ro
      - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      ziad_php:
        condition: service_started
    networks:
      - ziad_net

volumes:
  ziad_db_data:
networks:
  ziad_net:
