version: "3"
services:
  wordpress:
    image: wordpress
    ports:
      - "8089:80"
    depends_on:
      - mysql
    environment:
      WORDPRESS_DB_HOST: mysql
      WORDPRESS_DB_USER: root
      WORDPRESS_DB_PASSWORD: "Admin22"
      WORDPRESS_DB_NAME: wordpress
    networks:
      wpNetwork:
        ipv4_address: "10.20.1.1"
  mysql:
    image: "mysql:5.7"
    environment:
      MYSQL_DATABASE: wordpress
      MYSQL_ROOT_PASSWORD: "Admin22"
    volumes:
      - ./mysql:/var/lib/mysql
    networks:
      wpNetwork:
        ipv4_address: "10.20.1.2"
networks:
  wpNetwork:
    ipam:
      driver: default
      config:
        - subnet: "10.20.1.0/24"
