version: '3.1'

services:

  wordpress:
    image: wordpress
    container_name: wordpress
    restart: unless-stopped
    ports:
      - ${WEB_SERVER_PORT}:80
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: ${MYSQL_DATABASE_USER_NAME}
      WORDPRESS_DB_PASSWORD: ${MYSQL_DATABASE_PASSWORD}
      WORDPRESS_DB_NAME: wordpress
    networks:
      - wordpress     
    volumes:
      - wordpress:/var/www/html

  db:
    image: jc21/mariadb-aria:latest
    restart: unless-stopped
    environment:
      MYSQL_DATABASE: wordpress
      MYSQL_USER: ${MYSQL_DATABASE_USER_NAME}
      MYSQL_PASSWORD: ${MYSQL_DATABASE_PASSWORD}
      MYSQL_ROOT_PASSWORD: ${MYSQL_DATABASE_ROOT_PASSWORD}
    networks:
      - wordpress     
    volumes:
      - db:/var/lib/mysql

volumes:
  wordpress:
  db:

networks:
  wordpress: