version: '3.8'

services:
  php-fpm:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - ./:/var/www/html
      - ./supervisord.conf:/etc/supervisor/conf.d/supervisord.conf
    expose:
      - 9000

  nginx:
    image: nginx:alpine
    ports:
      - "8080:8080"
    volumes:
      - ./:/var/www/html
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - php-fpm

  autoreload:
    image: cosmtrek/air
    volumes:
      - .:/project
    working_dir: /project
    command: sh -c "air"
