version: "3"
services:
  # database (mysql)
  mysql:
    image: mysql:5.7
    container_name: ${PROJECT_NAME}-mysql
    volumes:
      - "./sourcefiles/mysql:/var/lib/mysql"
    environment:
      - MYSQL_USER=${MYSQL_USER}
      - MYSQL_ROOT_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_DATABASE=${MYSQL_DATABASE}
    ports:
      - "3306:3306"

  # webserver (nginx)
  webserver:
    image: nginx:alpine
    container_name: ${PROJECT_NAME}-webserver
    working_dir: /application
    volumes:
      - ./application:/application
      - ./sourcefiles/nginx:/etc/nginx/conf.d
    ports:
      - "9090:80"

  # php
  php-fpm:
    build: sourcefiles/php-fpm
    container_name: ${PROJECT_NAME}-php-fpm
    working_dir: /application
    volumes:
      - ./application:/application
