version: '3.8'

services:
  php:
    build: .
    restart: always
    volumes:
      - .:/var/www/html
    networks:
      - symfony

  nginx:
    image: nginx:alpine
    restart: always
    ports:
      - "127.0.0.1:8080:80"
    volumes:
      - .:/var/www/html
      - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - php
    networks:
      - symfony

  database:
    image: mariadb:11
    restart: always
    environment:
      MARIADB_ROOT_PASSWORD: root
      MARIADB_DATABASE: symfony
      MARIADB_USER: symfony
      MARIADB_PASSWORD: symfony
    volumes:
      - db_data:/var/lib/mysql
    ports:
      - "127.0.0.1:3307:3306"
    networks:
      - symfony

networks:
  symfony:

volumes:
  db_data:
