version: "3.4"

services:
  wp-aigorizm:
    image: wordpress:latest
    depends_on:
      db-aigorizm:
        condition: service_healthy
    ports:
      - "8003:80"
    environment:
      WORDPRESS_DB_HOST: db-aigorizm
      WORDPRESS_DB_USER: aigorizmusernaffco
      WORDPRESS_DB_PASSWORD: aigorizmNaffcoPass@#123
      WORDPRESS_DB_NAME: naffcoaigorizm
    volumes:
      - ./php-aigorizm.ini:/usr/local/etc/php/conf.d/uploads.ini
      - data_aigorizm:/var/www/html
    networks:
      - aigorizm_network
    restart: always

  db-aigorizm:
    image: mysql:5.7
    volumes:
      - db_data_aigorizm:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: aigorizmNaffcoPass@#123
      MYSQL_DATABASE: naffcoaigorizm
      MYSQL_USER: aigorizmusernaffco
      MYSQL_PASSWORD: aigorizmNaffcoPass@#123
    ports:
      - "3310:3306"
    networks:
      - aigorizm_network
    restart: always
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
      interval: 30s
      timeout: 10s
      retries: 5

volumes:
  data_aigorizm:
  db_data_aigorizm:

networks:
  aigorizm_network:
    external: true

