version: "2"

services:
  web:
    image: nginx:latest
    ports:
      - "8080:80"
    volumes:
      - .:/var/www:/var/www/
      - ./sites:/etc/nginx/conf.d
      - ./nginx.conf:/etc/nginx/ph7builder.conf
    depends_on:
      - php
    links:
      - php
  php:
    image: php:8.1.0-fpm
    volumes:
      - .:/var/www:/var/www/
    command: bash -c "composer install"
    working_dir: /var/www:/var/www/
  db:
    image: mysql
    ports:
      - "8001:5432"
