version: "3.1"
services:
  mariadb:
    image: mariadb
    container_name: mariadb
    restart: always
    environment: 
      - MYSQL_DATABASE=pms
      - MYSQL_ROOT_PASSWORD=password
    volumes: 
      - ./data:/var/lib/mysql

  nginx:
    image: nginx:alpine
    container_name: nginx
    working_dir: /application
    volumes:
      - .:/application
      - ./docker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
    ports:
      - "8001:80"

  php-fpm:
    build: ./docker/php-fpm
    container_name: php-fpm
    working_dir: /application
    volumes:
      - .:/application

  adminer:
    container_name: adminer
    image: adminer
    restart: always
    ports:
      - 8081:8080