version: '3'

networks:
  exchange-development:

services:
  #################################################################
  nginx:
    image: nginx:stable-alpine
    container_name: exchange-ngnix
    ports:
      - "8082:80"
    volumes:
      - ../:/var/www/html
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - php
      - mysql
    networks:
      - exchange-development
  #################################################################
  mysql:
    image: mysql:5.7.29
    container_name: exchange-mysql
    restart: unless-stopped
    tty: true
    ports:
      - 3302:3306
    environment:
      MYSQL_ROOT_USER: root
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: exchange-db
      MYSQL_USER: master
      MYSQL_PASSWORD: cDe7gcrRBWetaAP
      TZ: Asia/Singapore
    volumes:
      - mysql-data:/var/lib/mysql
    networks:
      - exchange-development
  #################################################################
  php:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: exchange-php
    volumes:
      - ../:/var/www/html
      - ./php/default.conf:/usr/local/etc/php-fpm.d/zz-docker.conf
      - ./php/php.ini:/usr/local/etc/php/conf.d/custom.ini
    ports:
      - "9002:9000"
      - "5173:5173"
    networks:
      - exchange-development
  #################################################################

volumes:
  mysql-data:
