services:
  # PHP Application
  app:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: cesizen-app
    restart: unless-stopped
    tty: true
    extra_hosts:
      - "host.docker.internal:host-gateway"
    volumes:
      - ./:/var/www
      - /var/www/node_modules
      - ./storage:/var/www/storage
    networks:
      - cesizen-network

  # Nginx Service
  webserver:
    image: nginx:alpine
    container_name: cesizen-webserver
    restart: unless-stopped
    tty: true
    ports:
      - "8090:80"  # WEB
      - "8091:81"  # API
    volumes:
      - ./:/var/www
      - ./nginx.conf:/etc/nginx/conf.d/default.conf
    networks:
      - cesizen-network

networks:
  cesizen-network:
    driver: bridge
