version: "3.4"

services:
  wp-iceberghubs:
    image: wordpress:latest
    depends_on:
      db-iceberghubs:
        condition: service_healthy
    ports:
      - "8010:80"
    environment:
      WORDPRESS_DB_HOST: db-iceberghubs
      WORDPRESS_DB_USER: iceberghubsusernaffco
      WORDPRESS_DB_PASSWORD: iceberghubsNaffcoPass@#123
      WORDPRESS_DB_NAME: naffcoiceberghubs
    volumes:
      - ./php-iceberghubs.ini:/usr/local/etc/php/conf.d/uploads.ini
      - data_iceberghubs:/var/www/html
    networks:
      - iceberghubs_network
    restart: always

  db-iceberghubs:
    image: mysql:5.7
    volumes:
      - db_data_iceberghubs:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: iceberghubsNaffcoPass@#123
      MYSQL_DATABASE: naffcoiceberghubs
      MYSQL_USER: iceberghubsusernaffco
      MYSQL_PASSWORD: iceberghubsNaffcoPass@#123
    ports:
      - "3318:3306"
    networks:
      - iceberghubs_network
    restart: always
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
      interval: 30s
      timeout: 10s
      retries: 5

volumes:
  data_iceberghubs:
  db_data_iceberghubs:

networks:
  iceberghubs_network:
    external: true
