version: '3.9'

services:
  wordpress:
    image: productzilla/wp-program:prod
    build:
      context: ../../
      dockerfile: ./misc/docker/dockerfile
    restart: always
    depends_on:
      - phpmyadmin
    ports:
      - '38080:80'
    environment:
      WORDPRESS_DB_HOST: mariadb
      WORDPRESS_DB_NAME: pz-program
      WORDPRESS_DB_USER: pz-program-user
      WORDPRESS_DB_PASSWORD: ProductzillaCool!!!
    volumes:
      - ../../:/var/www/html  # Mount your local WordPress directory
  mariadb:
    image: mariadb:10.3.10
    restart: unless-stopped
    environment:
      - MYSQL_ROOT_PASSWORD=ProductzillaProgram!!!
      - MYSQL_DATABASE=pz-program
      - MYSQL_USER=pz-program-user
      - MYSQL_PASSWORD=ProductzillaCool!!!
    healthcheck:
      test: ['CMD', 'mysqladmin', 'ping', '--silent']
      start_period: 30s
  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    depends_on:
      - mariadb
    restart: unless-stopped
    environment:
      - PMA_HOST=mariadb
      - UPLOAD_LIMIT=10000000000
    ports:
      - 31080:80
networks:
  productzilla:
    external: true
