version: '3'
services:

  # PHP Runtime Service
  abiofore_php_runtime:
    build:
      context: .
      dockerfile: ./docker/local/PHP_Dockerfile
    image: abiofore_php_runtime.com/php
    container_name: abiofore_php_runtime
    restart: unless-stopped
    tty: true
    environment:
      SERVICE_NAME: abiofore_php_runtime
      SERVICE_TAGS: dev
    working_dir: /var/www
    volumes:
      - ./:/var/www
      - ./docker/local/configuration/php/local.ini:/usr/local/etc/php/conf.d/local.ini
    networks:
      - abiofore-network

  # Nginx Service
  abiofore_nginx_webserver:
    image: nginx:alpine
    container_name: abiofore_nginx_webserver
    restart: unless-stopped
    tty: true
    ports:
      - "8094:80"
      - "4444:443"
    volumes:
      - ./:/var/www
      - ./docker/local/configuration/nginx/conf.d/:/etc/nginx/conf.d/
    networks:
      - abiofore-network

  # MySQL Service for application data
  abiofore_mysql_database:
    image: mysql:5.7.22
    container_name: abiofore_mysql_database
    restart: unless-stopped
    tty: true
    ports:
      - "3334:3306"
    environment:
      MYSQL_DATABASE: abiofore_dev_db
      MYSQL_ROOT_PASSWORD: secret
      SERVICE_TAGS: dev
      SERVICE_NAME: abiofore_mysql_database
    volumes:
      - ./docker/local/storage/abiofore-dev-database-data:/var/lib/mysql/
      - ./docker/local/configuration/mysql/my.cnf:/etc/mysql/my.cnf
    networks:
      - abiofore-network

# Docker Networks
networks:
  abiofore-network:
    driver: bridge

# Volumes
volumes:
  abiofore-dev-database-data:
    driver: local
