version: '3.8'

services:
  # PHP-FPM Service
  php:
    build: .
    container_name: tindoapi-php
    restart: unless-stopped
    working_dir: /var/www/html
    volumes:
      - ./:/var/www/html
      - ./writable:/var/www/html/writable
    environment:
      - PHP_IDE_CONFIG=serverName=tindoapi
    networks:
      - tindoapi-network

  # Nginx Service
  nginx:
    image: nginx:alpine
    container_name: tindoapi-nginx
    restart: unless-stopped
    ports:
      - "8089:80"
    volumes:
      - ./:/var/www/html
      - ./docker/nginx:/etc/nginx/conf.d
    networks:
      - tindoapi-network
    depends_on:
      - php

# Docker Networks
networks:
  tindoapi-network:
    driver: bridge
