version: '3.8'
services:
  site_owendo:
      build:
        context: .
        dockerfile: Dockerfile
        #target: php
        #args:
         #   - APP_ENV=${APP_ENV}
      ports:
        - 9000:9000
      

      environment:
          - APP_ENV=local
          
      container_name: 'site'      
      volumes:
          - ./:/var/www
          - /var/www/vendor          
      
      depends_on:
         - mysql


  mysql:
    image: 'mysql/mysql-server:8.0'
   
    environment:
        MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
        MYSQL_ROOT_HOST: '%'
        MYSQL_DATABASE: '${DB_DATABASE}'
        MYSQL_USER: '${DB_USERNAME}'
        MYSQL_PASSWORD: '${DB_PASSWORD}'
        MYSQL_ALLOW_EMPTY_PASSWORD: 1
    restart: unless-stopped
    ports:
        - '${FORWARD_DB_PORT:-3306}:3306' # Map host port 3306 to container port 3306
 
    volumes:
      - db-data:/var/lib/mysql

  

  
  nginx:
     image: nginx:latest
     working_dir: /var/www
     ports:
       - "80:80"
       #- "443:443"
   
     volumes:
       - .:/var/www/
       - ./nginx/nginx.conf:/etc/nginx/nginx.conf
     depends_on:
       - site_owendo
       - phpmyadmin


  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    #container_name: 'laravel-phpmyadmin'   
    restart: always
    ports:
      - 8081:80
    
    environment:
      PMA_HOST: 'mysql'
      PMA_USER: '${DB_USERNAME}'
      PMA_PASSWORD: '${DB_PASSWORD}'

    depends_on:
     - mysql

    volumes:
      - phpmyadmin_data:/var/www/phpmyadmin


  


networks:
  laravel-network:
    driver: bridge

volumes:
  db-data: ~
  phpmyadmin_data:

  #traefik-ssl-certs:
   # driver: local