version: "3.4"

services:
  wp-swesglobal:
    image: wordpress:latest
    depends_on:
      db-swesglobal:
        condition: service_healthy
    ports:
      - "8008:80"
    environment:
      WORDPRESS_DB_HOST: db-swesglobal
      WORDPRESS_DB_USER: swesglobalusernaffco
      WORDPRESS_DB_PASSWORD: swesglobalNaffcoPass@#123
      WORDPRESS_DB_NAME: naffcoswesglobal
    volumes:
      - ./php-swesglobal.ini:/usr/local/etc/php/conf.d/uploads.ini
      - data_swesglobal:/var/www/html
    networks:
      - swesglobal_network
    restart: always

  db-swesglobal:
    image: mysql:5.7
    volumes:
      - db_data_swesglobal:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: swesglobalNaffcoPass@#123
      MYSQL_DATABASE: naffcoswesglobal
      MYSQL_USER: swesglobalusernaffco
      MYSQL_PASSWORD: swesglobalNaffcoPass@#123
    ports:
      - "3315:3306"
    networks:
      - swesglobal_network
    restart: always
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
      interval: 30s
      timeout: 10s
      retries: 5

volumes:
  data_swesglobal:
  db_data_swesglobal:

networks:
  swesglobal_network:
    external: true
