version: '3.3'

services:

  nginx:
    build: ./requirements/nginx
    #image: nginx:stable-alpine
    #container_name: nginx
    depends_on:
      - php
      - mysql
    ports:
      - 80:80
      - 443:443
    volumes:
      #- wpfiles:/var/www/html
      - ./wordpress:/var/www/html
      - ./wordpress:/var/www/html3
      - ./wordpress:/var/www/html2
      #- ./requirements/nginx/conf/nginx.conf:/etc/nginx/conf.d/default.conf
    networks:
      - wpnetwork
    restart: always

  php:
    #build: ./requirements/wordpress
    image: php:7.4-fpm-alpine
    volumes:
     # - wpfiles:/var/www/html
     - ./wordpress:/var/www/html
    depends_on:
      - mysql
    networks:
      - wpnetwork
    #restart: always

  mysql:
    #build: ./requirements/mariadb
    image: mysql:latest
    #container_name: mariadb
    environment:
      #MARIADB_DATABASE: wp
      #MARIADB_USER: wp
      #MARIADB_PASSWORD: secret
      #MARIADB_ROOT_PASSWORD: secret
      MYSQL_DATABASE: wp
      MYSQL_USER: wp
      MYSQL_PASSWORD: secret
      MYSQL_ROOT_PASSWORD: secret

    volumes:
      #- ./requirements/mariadb:/var/lib/mysql
      #- wpfiles:/var/www/html
      - ./wordpress:/var/www/html
    networks:
      - wpnetwork
    #restart: always

networks:
  wpnetwork:
    driver: bridge

#volumes:
 # wpfiles: