version: '3.8'

services:
  nginx-php:
    build:
      context: ./nginx-php
      # dockerfile: ./nginx-php/Dockerfile
    container_name: "uding-nginx-php"
    # entrypoint: |
    #   /bin/sh -c "chown -R www:www /var/www"
    ports:
      - 8080:80
    volumes:
      - "./app:/var/www"
    networks:
      - internal
  mysql:
    build:
      context: .
      dockerfile: ./mysql/Dockerfile
    container_name: "uding-mysql"
    ports:
      - "3306:3306"
    networks:
      - internal
    volumes:
      - ./data/mysql:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: admin  
  redis:
    image: redis
    container_name: "uding-redis"
    networks:
      - internal
  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: "uding-myadmin"
    ports:
      - "888:80"
    networks:
      - internal
    environment:
      PMA_HOST: mysql
      PMA_PORT: 3306
      UPLOAD_LIMIT: 100M
networks:
  internal:
    driver: bridge
