version: '3.8'

services:
  wordpress:
    image: wordpress:latest
    container_name: navier-wordpress
    restart: unless-stopped
    ports:
      - "8090:80"
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
      WORDPRESS_DB_NAME: wordpress
    volumes:
      - wordpress_data:/var/www/html
      - ./theme:/var/www/html/wp-content/themes/navier-instruments
    depends_on:
      - db

  db:
    image: mysql:8.0
    container_name: navier-mysql
    restart: unless-stopped
    environment:
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress
      MYSQL_ROOT_PASSWORD: rootpassword
    volumes:
      - db_data:/var/lib/mysql

  phpmyadmin:
    image: phpmyadmin:latest
    container_name: navier-phpmyadmin
    restart: unless-stopped
    ports:
      - "8091:80"
    environment:
      PMA_HOST: db
      MYSQL_ROOT_PASSWORD: rootpassword
    depends_on:
      - db

volumes:
  wordpress_data:
  db_data:
