version: "3.4"

services:
  wp-naffcoaus:
    image: wordpress:latest
    depends_on:
      db-naffcoaus:
        condition: service_healthy
    ports:
      - "8009:80"
    environment:
      WORDPRESS_DB_HOST: db-naffcoaus
      WORDPRESS_DB_USER: naffcoaususernaffco
      WORDPRESS_DB_PASSWORD: naffcoausNaffcoPass@#123
      WORDPRESS_DB_NAME: naffcoaus
    volumes:
      - ./php-naffcoaus.ini:/usr/local/etc/php/conf.d/uploads.ini
      - data_naffcoaus:/var/www/html
      - /var/www/html/naffcoaus.com/public_html/wp-content/ai1wm-backups:/var/www/html/wp-content/ai1wm-backups
    networks:
      - naffcoaus_network
    restart: always

  db-naffcoaus:
    image: mysql:5.7
    volumes:
      - db_data_naffcoaus:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: naffcoausNaffcoPass@#123
      MYSQL_DATABASE: naffcoaus
      MYSQL_USER: naffcoaususernaffco
      MYSQL_PASSWORD: naffcoausNaffcoPass@#123
    ports:
      - "3314:3306"
    networks:
      - naffcoaus_network
    restart: always
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
      interval: 30s
      timeout: 10s
      retries: 5

volumes:
  data_naffcoaus:
  db_data_naffcoaus:

networks:
  naffcoaus_network:
    external: true

