version: "3.4"

services:
  wp-latest:
    image: wordpress:latest
    depends_on:
      db-latest:
        condition: service_healthy
    ports:
      - "8006:80"
    environment:
      WORDPRESS_DB_HOST: db-latest
      WORDPRESS_DB_USER: latestusernaffco
      WORDPRESS_DB_PASSWORD: latestNaffcoPass@#123
      WORDPRESS_DB_NAME: naffcolatest
    volumes:
      - ./php-latest.ini:/usr/local/etc/php/conf.d/uploads.ini
      - data_latest:/var/www/html
    networks:
      - latest_network
    restart: always

  db-latest:
    image: mysql:5.7
    volumes:
      - db_data_latest:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: latestNaffcoPass@#123
      MYSQL_DATABASE: naffcolatest
      MYSQL_USER: latestusernaffco
      MYSQL_PASSWORD: latestNaffcoPass@#123
    ports:
      - "3313:3306"
    networks:
      - latest_network
    restart: always
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
      interval: 30s
      timeout: 10s
      retries: 5

volumes:
  data_latest:
  db_data_latest:

networks:
  latest_network:
    external: true

