version: "3.3"
services:

  web:
    image: nginx:latest
    container_name: infusionsoft-php-nginx
    ports:
      - "80:80"
    volumes:
      - "${INFUSIONSOFT_PHP_WORKING_DIR-.}:/var/www/html"
      - "${INFUSIONSOFT_PHP_WORKING_DIR-.}/docker-nginx-config:/etc/nginx/conf.d"
    links:
      - php

  php:
    image: php:8.1-fpm
    container_name: infusionsoft-php
    volumes:
      - "${INFUSIONSOFT_PHP_WORKING_DIR-.}:/var/www/html"

  composer:
    image: composer:latest
    volumes:
      - ${INFUSIONSOFT_PHP_WORKING_DIR-.}:/app
    command: "composer install --optimize-autoloader --no-interaction --no-progress"
    profiles: ["install"]
